generic c# class for SELECT, INSERT, UPDATE and DELETE operations in asp.net
I'm searching for a code example/link that does what the title says.
Basically I need to create a data access layer for my asp.net website, and I want it to be as generic as possible. I prefer to work with stored procedures and data tables and the respective c# ado.net code for the sake of performance.
If anyone has comments/开发者_C百科suggestions/corrections please feel free to say it.
Thanks.
Sounds like you are describing the DataAdapter
class.
You should have to use/learn LINQ-SQL
, Entity Data Model
framework, and EDM code first
.
I used the sample from this one in the past. It was really well done. I added what I needed but as a generic DAL it was pretty solid.
http://www.codeproject.com/KB/dotnet/Generic_DAL_in_NET_20.aspx
Dapper is what StackOverflow uses: http://code.google.com/p/dapper-dot-net/
Here is a list of other ORMs: http://amrelgarhy.com/47/orm-tools-net/
Use SqlHelper Class from Microsoft Enterprse Library.Data Application Block.
精彩评论