views:

154

answers:

5

As I am a beginner to ASP.NET MVC, I would like to know what are the best data access methods for ASP.NET MVC?

A: 

Have a look at the NerdDinner tutorial. It will pretty much tell you everything you need to know.

The part of the tutorial that talks about data access methods is here: http://nerddinnerbook.s3.amazonaws.com/Part3.htm

Robert Harvey
are you suggesting me to use linq to sql in asp.net mvc?
Pandiya Chendur
A: 

As ASP.NET MVC is all about TDD and separation of concerns it is more natural to use any type of ORM for data access (NHibernate, Entity Framework, LINQ to SQL etc.). What type of ORM - depends on your project goals and experience.

Voice
+1  A: 

This is somehow subjective. There's no such thing as best data access method for ASP.NET MVC. This will depend on your application requirements and specific needs. There are many different ORM frameworks you can choose from such as NHibernate, Entity Framework, Linq to SQL, ... (If there was a best framework this list wouldn't be so big).

Darin Dimitrov
Thanks Darin for ur valuable answer .. one more thing i really want to know what data access method stackoverflow.com uses?
Pandiya Chendur
If I am not mistaken in the beginning it was Linq-to-SQL but maybe they upgraded to Entity Framework.
Darin Dimitrov
A: 

If you're just learning MVC, and are ok with SQL server, then I would recommend using Linq to SQL for a start. Later you can then introduce more powerful ORM like NHibernate or EF. If you try to tackle MVC and something like NHibernate at once you will likely bite off more than you can chew.

UpTheCreek
ok sosh i ll give a try with linq to sql.... what data access method stackoverflow.com uses?
Pandiya Chendur
Actually Stackoverflow uses Linq to SQL (to the best of my knowledge). Personally I don't like the lock in to MSSQL, but it obviously can perform.
UpTheCreek
A: 

This is a really good article on which practice of data access to choose:

Article Link

tuanvt