Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most used method for accessing database from C# nowadays [closed]

Tags:

c#

database

Ok, I am asking this question because I am totally confused. I used to use normal approach to access databases from C#(I mean by using SQLConnection, OracleConnection, SQLCommand, executequery etc.). Then I heard about ADO.NET, ORM and learned NHibernate(not a pro, but I can manage).

Recently I don't see any particular activities regarding NHibernate a lot. People around me who used to use NHibernate(and was a fan) are now moving to other methods.

So what is the most used database access method nowadays? How can I keep track of this changing trend?

like image 730
MD Sayem Ahmed Avatar asked Jul 15 '10 13:07

MD Sayem Ahmed


2 Answers

The most common methods are probably these:

  • LINQ to SQL
  • Entity Framework
  • ADO.NET directly
  • NHibernate
  • Other O/RMs.

All of them are still in use and they have different advantages and disadvantages. I think Microsoft are currently trying to encourage people to use the Entity Framework.

like image 112
Mark Byers Avatar answered Sep 19 '22 17:09

Mark Byers


There is only one way - ADO.NET for SQL Server. More particular, the Connection and Reader objects in there. Now, you may say there are things like Entity Framework - but interesting enough they are ABOVE the real access layer, using both access elements named before. Even DataSets are a higher layer (the data is read through a DataReader).

So what is the most used database access method nowadays?

I bet it STILL is datasets. The amount of uneducated following the drag and drop principle is IMHO still the majority, and this approach in visual studio leads to Datasets.

Professionals use an ORM of sorts. Entity Framework is pretty pushed now by people who mostly do not really know what an ORM can do it programmed properly. Right now my best bet is still NHibernate for a high quality layer.

like image 33
TomTom Avatar answered Sep 21 '22 17:09

TomTom