How to Link VS2010 Database Project and LINQ to SQL
Posted
by Jason
on Stack Overflow
See other posts from Stack Overflow
or by Jason
Published on 2010-05-18T21:23:35Z
Indexed on
2010/05/18
23:30 UTC
Read the original article
Hit count: 962
As I am working with the new database projects in VS2010, and as I am learning LINQ to SQL, I am curious as to the best way to link the two groups of information so that when I update one, the other updates along with it.
From my research here at SO, as well as in Google, it appears the general rule of thumb is: "Build the database, and then create your LINQ to SQL classes." Of course, if I make a change in my database, the LINQ to SQL doesn't update automatically and I have to do it by hand. This is fairly simple right now as my database is small, but I am curious if there is an easier way for this to happen.
In addition, the LINQ to SQL tool is pretty nice. The ability to create tables, add associations, and even create inheritance is very simple. As my second question, I am curious as to whether or not VS2010 can work the other way - I design the database in the DBLM file and then link it back to my database project.
I appreciate any help with either of these two questions. I'm really interested in making this as easy as possible to reduce errors during development and improve the speed at which changes can be made.
© Stack Overflow or respective owner