Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update .dbml file

How to update .dbml file after making some changes in the database.

like image 730
Niraj Choubey Avatar asked Dec 12 '22 20:12

Niraj Choubey


2 Answers

There's no built-in way to sync the dbml file/datacontext with the database after making changes (besides regenerating the entire dbml file by removing all or a selection of the entities and re-dragging them, or by using sqlmetal as suggested by other replies), but there are third-party tools that add refresh functionality to the Visual Studio L2S designer.

One such tool is my add-in, Huagati DBML/EDMX Tools. You can download it from http://www.huagati.com/dbmltools/ and get a trial license if you want to take it for a test spin.

Jim Wooley has a summary various Linq and Linq-to-SQL tools here:
http://www.thinqlinq.com/default/LINQ-Tools.aspx

...and Damien Guard has a list of tools/resources for L2S here:
http://damieng.com/blog/2009/06/04/linq-to-sql-resources

like image 78
KristoferA Avatar answered Dec 22 '22 00:12

KristoferA


The only way to do this is to delete the objects from the dbml interface, and re-add them back. Make sure that you hit Refresh in the Server Explorer panel after making changes to the database so that Visual Studio picks up the latest changes to the database when it creates the objects in the dbml.

like image 40
Tim S. Van Haren Avatar answered Dec 22 '22 00:12

Tim S. Van Haren