Al Pascual


Geo RSS
Geo Twitter Timeline

Blogs I read

<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

Why there is still a limitation in LINQ to SQL?

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

Comments

Dew Drop - May 2, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - May 2, 2008 | Alvin Ashcraft's Morning Dew

# May 2, 2008 9:09 AM

Michael Washington said:

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.
# May 6, 2008 1:02 PM

Community Blogs said:

Previously I have been talking about the limitations of Linq to SQL for your data layer. You should read

# June 20, 2008 5:41 AM

Kristofer said:

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: http://blog.huagati.com/res/index.php/2008/07/07/tools-part-1
# July 29, 2008 11:45 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Protected by FormShield
Refresh
Listen
Please enter the characters shown on the image


Code: