LINQ to SQL was going to be the solution that all developers have been asking for to be able to use databases. Now developers would be able to interact with a database using C# and SQL language together and get intellisense to their tables. This for a second how bad was to create your store procedures and then call them outside from C# to see if they were working. Separating the business layer and the database layer was a long job at every project.
DataAdapters are here!
Along came the dataAdapters to give you a hand and providing a way to generate code from your database. I do believe that dataAdapters were the right direction and the the beginning of Dynamic Data (LINQ to SQL) At .NET 2.0 many people started using dataAdapters and creating their own queries. Problem at the time that many people left as feedback to Microsoft, was the problem in being disconnected from the database after dropping the fields on the dataAdapter.
The new generation comes to life.
Last year a “ScottGu” blog releases the news and the main features of the project ASP.NET Dynamic Data and LINQ to SQL, a new object relation mapper that will support transactions, views and stored procedures. With all the features we were expecting an automatic refresh against the schema of the database. As databases changes happen more often that we would like to, should be a way to refresh the entry to the LINQ to SQL object map. I have wrongly assumed that feature to be included.
When I read back in March 2007 the MSDN article about LINQ to SQL "Your application is free to manipulate the objects while LINQ to SQL stays in the background tracking your changes automatically" I thought that LINQ to SQL will sync the changes for me. I misunderstood that statement. I believe now that was talking about transactions with the LINQ method SubmitChanges();
LINQ to SQL will track the changes to the dataset and then you can apply only the deltas back to the database.
But wait, there is more.
LINQ to SQL also provides Take() like SQL TOP x and Skip() to be able to skip rows on the selection as well as many methods in .NET that can be applied back to the database.
What other solutions are there?
To get a synchronized data layer now we need to start looking outside the solution provided by Microsoft. There are other solutions out there like LINQ to SQL with refresh?
Related Posts
LINQ to SQL series
Scott Guthrie LINQ to SQL series
MSDN LINQ to SQL
Cheers
Al