Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi

Forgive me for sounding like a newbie, but I would like to know what the current best way is to work with a SQL database. I recently had to design a program in which I worked with a SQL database, and the way I accessed data was to create 2 seperate classses for each Table, and then I used these classes to call the stored procedures that I wrote to read and write data to and from the database.

Just the other day I saw that one can simply add an ADO.NET Entity Model and associate it with your SQL database. This creates objects for each of your tables as well as methods such as "AddToTable". This results in far less code than my previous attempt. I know its good to know how the background stuff works e.g how these objects and methods are actually created etc., but once one knows all that, is it a good approach to simply let .NET do most of the work for you?
Posted

1 solution

The best way to handle data access is what works for the project. What works for one may not be the best for another project.

Entity Framework is a good, and so is nHibernate.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900