Code example of Database DAL; "ADO.NET datasets" and "LINQ to SQL"
I'm making a database DAL for SQL Compact. I will use either "ADO.NET DataSets" or "Linq to Sql". But not sure yet which. I just want the one that is faster/easier to work with. And is type safe. Could you please point me to some example projects/code that shows me how to build a DAL开发者_StackOverflow with these individual concepts? The DAL should transfer the data to existing business objects.
I'm not asking out of lazyness, been searching for hours, but in all examples I find hard typed TSQL strings, which I thought could be avoided, and no complete examples that shows what I try to make.. If you know some, it would be really helpful.
first lets talk about linq to sql 1> its easy to use 2> good for beginners 3> if the database structure is not complicated microsoft stop working on linqtosql after 2008 so there will not be any more update now
ado entities are bit complicated but have more options then linq to sql,even u can say linq to sql is the sub set of ado entities,
there is not events in linq to sql and in ado entities u have 3 events to track like u can fire a event when ever new entity is add... ado entities give more performance the linq to sql...
So hard to find complete simple example on such DAL design, which newbies need. I found this one, was great, although neither LINQ or Entities, it's very nice for the design pattern, and well documented;
http://www.simple-talk.com/dotnet/.net-framework/.net-application-architecture-the-data-access-layer/
精彩评论