views:

52

answers:

2

I have been asking my self this question from the time i started workin in the software development field,

What is the best way to access data? Which gives the best performance? Which is the best for maintainability?

There are lots of solutions to deal with database in the Asp.Net web app,

  1. Entity framework 4.0
  2. Classes generator using ADO.Net such as Code Author ( i liked the way it works and the way it accesses the database using the data access block in Microsoft Enterprise Library).

i will start a new project tomorrow,and i don't know which approach is better??Any idea?

+1  A: 

I'm using Castle Active Record for data access in our new ASP.NET project. It's a great and easy tool that is built upon NHibernate. NHibernate itself is a great ORM for .Net.

afsharm
I found the website of the Castle Active Record http://www.castleproject.orgbut i don't know where to download the generator!Also i would like to ask,,does it generate the CRUD stored procedures and the classes ,or should i do some manual work as i read in the get started section?
Khaled
@Khaled: You just create your classes and inherit it from a specific base class then AR takes cares all things for you. getting started page: http://www.castleproject.org/activerecord/gettingstarted/index.html - download page: http://www.castleproject.org/castle/download.html - direct download link: http://sourceforge.net/projects/castleproject/files/ActiveRecord/2.1/AR%202.1.1.zip/download -
afsharm
+1  A: 

There is no "best". There is only preference. Some like MVC, some like WebForms, some like Dynamic Data. Entity Framework works nicely, as does LINQ to SQL(although I hear that one is being deprecated, but I'm fuzzy on that.) All work well.

Personally, I like WebForms, but if I want a quick and dirty CRUD app, I always opt for Dynamic Data, and if I need additional functionality mixed in, I can throw in some standard WebForm aspx pages.

Performance wise, I don't know that there's inherently a big difference. All use the same code under the hood. All are based on ADO.NET. Entity Framework and LINQ to SQL seem to have additional overhead compared to the old-fashioned WebForms, but proper DB design and planning is probably of greater importance.

David Stratton