Showing posts with label model. Show all posts
Showing posts with label model. Show all posts

Thursday, April 11, 2013

How to update Linq to SQL dbml database layout in Visual Studio 2012?

I have not been working with the Linq to SQL tool before and had to make some changes to an existing Visual Studio 2012 project. Some new colums were added to a database table and i needed to update the corresponding dbml file in the Visual Studio project.

How-i-fixed-it:
I found the solution here: http://stackoverflow.com/questions/1110171/how-to-update-linq-to-sql-dbml-file

Delete the modified tables from the designer, and drag them back onto the designer surface from the Database Explorer. I have found that, for this to work reliably, you have to:
a. Refresh the database schema in the Database Explorer (right-click, refresh)
b. Save the designer after deleting the tables
c. Save again after dragging the tables back.