How to update .dbml file after making some changes in the database.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With