title: Which is the "best" data access framework/approach for C# and .NET?
body: <p>(EDIT: I made it a community wiki as it is more suited to a collaborative format.)</p>
  
  <p>There are a plethora of ways to access SQL Server and other databases from .NET. All have their pros and cons and it will never be a simple question of which is "best" - the answer will always be "it depends".</p>
  
  <p>However, I am looking for <strong>a comparison at a high level of the different approaches and frameworks in the context of different levels of systems</strong>. For example, I would imagine that for a quick-and-dirty Web 2.0 application the answer would be very different from an in-house Enterprise-level CRUD application.</p>
  
  <p>I am aware that there are numerous questions on Stack Overflow dealing with subsets of this question, but I think it would be useful to try to build a summary comparison. I will endeavour to update the question with corrections and clarifications as we go.</p>
  
  <p>So far, this is my understanding at a high level - but I am sure it is wrong...
  I am primarily focusing on the Microsoft approaches to keep this focused.</p>
  
  <h2><a href="http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework" rel="noreferrer">ADO.NET Entity Framework</a></h2>
  
  <ul>
  <li>Database agnostic</li>
  <li>Good because it allows swapping backends in and out</li>
  <li>Bad because it can hit performance and database vendors are not too happy about it</li>
  <li>Seems to be MS's preferred route for the future</li>
  <li>Complicated to learn (though, see <a href="https://stackoverflow.com/questions/267357/how-is-the-net-entity-framework-overkill-versus-linqtosql">267357</a>)</li>
  <li>It is accessed through <a href="http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework#LINQ_to_Entities" rel="noreferrer">LINQ to Entities</a> so provides ORM, thus allowing abstraction in your code</li>
  </ul>
  
  <h2><a href="http://en.wikipedia.org/wiki/Language_Integrated_Query#LINQ_to_SQL" rel="noreferrer">LINQ to SQL</a></h2>
  
  <ul>
  <li>Uncertain future (see <a href="http://www.infoq.com/news/2008/11/DLINQ-Future" rel="noreferrer">Is LINQ to SQL truly dead?</a>)</li>
  <li>Easy to learn (?)</li>
  <li>Only works with MS SQL Server</li>
  <li>See also <a href="https://stackoverflow.com/questions/271384/pros-and-cons-of-linq-language-integrated-query">Pros and cons of LINQ</a></li>
  </ul>
  
  <h2>"Standard" ADO.NET</h2>
  
  <ul>
  <li>No ORM</li>
  <li>No abstraction so you are back to "roll your own" and play with dynamically generated SQL</li>
  <li>Direct access, allows potentially better performance</li>
  <li>This ties in to the age-old debate of whether to focus on objects or relational data, to which the answer of course is "it depends on where the bulk of the work is" and since that is an unanswerable question hopefully we don't have to go in to that too much. IMHO, if your application is primarily manipulating large amounts of data, it does not make sense to abstract it too much into objects in the front-end code, you are better off using stored procedures and dynamic SQL to do as much of the work as possible on the back-end. Whereas, if you primarily have user interaction which causes database interaction at the level of tens or hundreds of rows then ORM makes complete sense. So, I guess my argument for good old-fashioned ADO.NET would be in the case where you manipulate and modify large datasets, in which case you will benefit from the direct access to the backend.</li>
  <li>Another case, of course, is where you have to access a legacy database that is already guarded by stored procedures.</li>
  </ul>
  
  <h2>ASP.NET Data Source Controls</h2>
  
  <p>Are these something altogether different or just a layer over standard ADO.NET?
  - Would you really use these if you had a DAL or if you implemented LINQ or Entities?</p>
  
  <h2>NHibernate</h2>
  
  <ul>
  <li>Seems to be a very powerful and powerful ORM?</li>
  <li>Open source</li>
  </ul>
  
  <p>Some other relevant links;
  <a href="https://stackoverflow.com/questions/53417/nhibernate-or-linq-to-sql">NHibernate or LINQ to SQL</a>
  <a href="https://stackoverflow.com/questions/8676/entity-framework-vs-linq-to-sql">Entity Framework vs LINQ to SQL</a></p>