Why there is still a limitation in LINQ to SQL?

written by Al on Thursday, May 01 2008

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

 

Similar Posts

  1. Writing good performance web application for the masses. Twitter FAQ?
  2. The future of databases is here, Microsoft SQL 2008
  3. Using LINQ to SQL makes life easier. An introduction of LINQ to SQL.

Comments

  • Michael Washington on on 5.06.2008 at 1:02 PM

    Michael Washington avatar

    When my databse changes I just delete the table in the Linq to SQL class and re-add it. The only problem is I also have to re-add the relationships but this only takes 1 minute. Refresh would be nice but since I could have altered the Linq to SQL class I can see why they don't do that.

  • Kristofer on on 7.29.2008 at 11:45 PM

    Kristofer avatar

    Hi Al,

    I wrote an add-in for Visual Studio that adds dbml refresh functionality - it will apply db schema changes such as added/removed/changed columns, added/removed tables, added/removed/changed FKs, PK changes etc to the dbml file.

    The add-in is described in more detail over at:

    blog.huagati.com/.../tools-part-1

Comments are closed

Options:

Size

Colors