Recommendations for accessing a C # database

Hi, I programmed a fair bit of C #, but never with a database. I would like to use SQL Server with C # with some structure. Apparently, Microsoft has launched a number of frameworks for the whole life of C #. This makes search / selection difficult.

Which one to choose? I am developing a simple 3-tier webapp. I watched several videos of Entity Framework .NET 4.0, but it seems to me that everything is too automatic. I need to do SQL from time to time.

And if I have to go to EF4.0, this is really the best link http://msdn.microsoft.com/en-us/library/bb386876.aspx

Any recommendations?

+7
source share
5 answers

Migrating from Entity Framework 4 is a modern and promising approach to SQL Server database. It is the basis for WCF data services, and the idea of ​​a conceptual model will be displayed in another Microsoft product, of course (Reporting Services and others, possibly).

And that gives you a lot of hooks that let you execute SQL statements on the fly, and you can integrate stored procedures very well in the Entity Framework.

And for the "run of the mill" everyday tasks, it gives you good C # objects - based on your database - for work.

In my opinion, this is your best choice at the moment - and the one that has the most flexibility and capabilities. You can start with a database (first “database”) and create your classes from existing tables; or you can start with a model and have EF4 to generate your database for you, and EF v4.1 (expected quite soon) will also offer a “code first” development where you don't even need a visual model, but you can describe all your objects databases and settings only in C # code.

Update:

+6
source

I would say: Start with Rob Conery Sub Sonic .. Its easy to start with ..specillaly Simple Repository ..

Link to the site: http://www.subsonicproject.com/

Simple repository using Sub Sonic: http://subsonicproject.com/docs/Simple_Repo_5_Minute_Demo

Update: I saw one answer mentioning NHibernate and want to add a little addition to the same ... and since the OP said you have good experience with C #, I assume that you have good OOPS knowledge, and also the relationship between objects.

I personally found it very easy to start with NHibernate when using it with Fluent NHibernate, so I would also suggest

C # + NHibernate + Fluent Nhibernate ....

+2
source

C # + ActiveRecord + NHibernate. Hide the implementation behind multiple WCF services.

+2
source

You said you want to try some of the frameworks, so the Entity Framework is the one. This is the result of MS best practice after several years of research. Of course, on the way, you can always use SQL (Dataset) at any time along with EF (mainly for performance tuning).

+2
source

Look here for some performance / benchmarking information for various ORM structures for .Net.

+1
source

All Articles