2

If you were programming a small database application in .NET 2008 right now would use plain ADO.Net or ADO.Net Entity Framework or some of both both?

I'm using Visual Studio 2008 to learn .Net. I already do quite a bit of programming in MS Access VBA but I've decided it's time to move past the desktop and past the 90's. My question is partially about what I should learn but also very much about what I should actually use in the real world.

4 Answers 4

4

Technically Entity Framework is the evolution of ADO.Net. Do yourself a favor and dump data sets in favor of a more robust ORM. At this point nobody should be passing around DataSets anymore.

It is worth noting that Entity Framework is not your only option when it comes to ORMs. There is NHibernate, SubSonic, LINQ to SQL, etc... All of which will work just fine in 2008. EF 1 is not fully baked in my opinion.

Sign up to request clarification or add additional context in comments.

1 Comment

Five years on from when I asked this and we're finding Entity Framework queries far too limited and ADO.NET DataReader's to have better performance. I now disagree with the "at this point nobody should be passing around DataSets anymore" idea. Still going to use EF Code First with Migrations anyway, but our GET queries are turning out to be mostly raw SQL and more and more using DataReaders for the extra speed.
3

I would not use the version of Entity Framework that comes with VS 2008. Entity Framework with VS2010 is fine.

I likely wouldn't use ADO.NET either as I always seem to end up writing my own custom ORM then.

For .NET 3.5 / VS 2008, I would recommend NHibernate. Linq To Sql is maybe an option if you want to get started quickly and can throw away the project after you are done (since any project with a long life will probably have to be rewritten to use EF or NHibernate anyway).

So, try NHibernate first, if the learning curve is too intimidating, drop back to LinqToSql or EF. Once you've learned one ORM, learning the second ORM is much easier.

Also, you can read a lot more on choosing an ORM for .NET here:

NHibernate, Entity Framework, active records or linq2sql

2 Comments

+1 for LINQ TO SQL. And without knowing the size & scope of his project, you shouldn't say that he'll have to throw away the project. There are thousands of L2S apps running out there just fine. So long as the SQL queries remain efficient enough, there's no reason I'm aware of to re-do the apps just because MS says L2S is dead.
@Graham: I didn't say he'd have to throw away the project. There are tons of apps using RDO/ADO/OLEDB/ODBC and whatever other database technologies Microsoft has long since abandoned. Why recommend that someone use an abandoned technology for a new code base?
0

If your database is small enough and you don't have a lot of queries, do ADO.NET, but if you are taking anything of scale, do the Entity Framework as it will be worth the overhead. The data generation and native query keywords will drastically reduce errors.

3 Comments

Do you maintain your answer knowing that VS 2008 uses only EFv1, not the newer and better EFv4?
@HK1: yes, VS2008 works with and on .NET 3.5 only --> EF v1. EF v4 is available on .NET 4 only --> you need VS 2010 for that
Thanks, I don't think you totally understood my question. I've read that EF v1 was not really ready to be used but EF v4 in VS 2010 has been getting much better reviews since MS has fixed a lot of the issues that existed in EF v1. Josh mentions the same in his answer.
0

If you learning, use EF. Whats the point of going backwards. It makes dev a LOT easier. The ADO/Dataset way of doing things is dead. Also if you moving to the web then it is nice to use EF with WCF data services. Its a neat trick to know.

Secondly, why use 2008. IF you learning, get the latest tools. The express editions are really great.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.