I'm a new developer in ASP.NET MVC. I want to create a Login page for user account in my application. I saw many tutorials that work with Enity Framework but I preferred to work with SQL and now I cant decide to choose which one! Can anyone explain that is it better to use SQL or EF? Any answers can be very helpful.
Thanks
- 1,013
- 1
- 17
- 48
-
2Check this posts: [Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures][1] [1]: http://stackoverflow.com/questions/2698151/entity-framework-vs-linq-to-sql-vs-ado-net-with-stored-procedures – BizApps Apr 24 '12 at 23:17
-
Tena the link you described is a good start – krystan honour Apr 25 '12 at 14:57
1 Answers
Ok so it's a matter of preference,
When you say use EF or sql I take it you mean ADO with sprocs and perhaps dynamic sql. Also there is NHibernate to consider.
Ultimately ORMs like entity framework or NHibernate can save a lot of the heavy lifting and repetative code associated with traditional database methods (like ADO) they are themselves are using that technology to execute in somecases.
The ORMs provide an abstraction that makes things easier to work with for developers because you are working with objects and not datasets (which traditionally Devs find harder to work with if they are from an O-O background).
This technology however has its own learning curve. I would suggest you take a look at implementing the code and perhaps just use plain SQL for now if you are not confident with the other technology and implement your feature.
Once you have it working and are happy the other MVC stuff works right you could perhaps refactor the code to use EF. Its really going to be dependant on how much you want to use.
Personally I like using ORMS over stored procedures for Most querys (especially CRUD operations) but some people swear by sprocs and sql. In reality most applications will use both as sprocs have advantages when it comes to bulk operations.
What is more important than the implementation tech used for the data layer is , that the data layer is well designed
- 6,523
- 3
- 36
- 63
-
Thanks Krystan, your answer was clear and right for me. Now I'm more encouraged to work with sql and I think it's better for me, but I couldn't find a good resource about working with sql in MVC3 for create Login page, most of them work with EF and I want to find out how can I work with sql. I think I should search more. – starrr Apr 25 '12 at 10:29
-
There is absolutely reason you can't use EF but I'd advise reading up on it first. – krystan honour Apr 25 '12 at 12:17
-
is this link suitable for start: http://geekswithblogs.net/dotNETvinz/archive/2011/06/03/asp.net-mvc-3-creating-a-simple-sign-up-form.aspx – starrr Apr 25 '12 at 12:48
-