Information about a modern connection structure

Rabinhood

New member
Joined
Mar 18, 2021
Messages
4
Programming Experience
1-3
I am a vb programmer and want to converting my project to c #.
I would like to use a modern sql server connection system (linq, Entity Framework, other) and I would like some advice on which one to choose in order to start studying it.
Thank you
 
VB6 or VB.NET programmer?
 
VB.net but I want to convert my project in C#.
In the previous software I used dataset and Access. Now I use SQL server but I dont' know what type of connection use.
 
Going from VB.NET to C# is mostly just a mechanical process of switching from the VB.NET syntax to the C# syntax. There's a few places where you would need to do a more extensive re-write because C# doesn't have the WITH keyword, as well as, a few other places where VB.NET provides some convenient inline text support.

I recommend a 3 stage conversion. First convert from VB.NET to C#, but continue to use ADO.NET talking to DataSet's and your Access database. Once that is working, convert over from an Access database to a SQL database, but continue to use ADO.NET. And then finally switch over to using EF.

(Personally, I wouldn't recommend EF, but that's because I've been burned in the past with the older versions of EF. People say that the current version of EF is much better.)
 
It is not a choice between LINQ and EF. LINQ is an overarching technology for querying data structures and there are numerous LINQ providers for different types of data structures. There's LINQ to Objects for querying regular lists, LINQ to XML, LINQ to DataSet and various others. If you do use EF then you'll be using the LINQ to Entities provider to query your DbContext. If you're not using LINQ then you're not using EF as it was intended.

Personally, I've been using EF for a long time and have had no real issues with it, so it gets my recommendation. I'm currently working mainly on a .NET 5.0/ASP.NET Core/EF Core application for a department of the Australian federal government. The fact that it's a Microsoft technology helps if you're using Visual Studio. I have no experience with it but I've heard good things about Dapper, so I'd suggest that, all else being equal, they are your two main options if you want to use an ORM rather than straight ADO.NET.
 
Back
Top Bottom