Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refreshing a DBML diagram?

Really stupid question, sorry, but I can't find it on google (I'm sure it's in a screencast or something somewhere). I have a DBML (linq2sql classes) diagram and I've changed the underlying database. In VS2008, how do I "refresh" the diagram? There's no View-->Refresh or RightClick->Refresh or Update option.

As it stands now, I have to recreate the entire linq2sql classes every time I update the underlying db.

like image 251
Chris Avatar asked May 13 '09 04:05

Chris


2 Answers

right click and select "run custom tool" (in solution explorer on dbml file)

like image 177
Ali Shafai Avatar answered Sep 22 '22 08:09

Ali Shafai


If you want to bring database changes into your DBML diagram then you can:

a) remove the changed entities from the designer diagram and re-drag them. You will lose any customizations (e.g. class and property name changes etc).

b) manually update the diagram, adding/removing classes, member properties, etc.

c) Use a third party tool capable of comparing and updating the DBML file with the underlying database. One such tool is my add-in, Huagati DBML/EDMX Tools. It adds a bunch of features to the L2S designer in VS2008 and VS2010, including update/sync, comparison, mass-renaming, name rule enforcement, documentation from extended properties/indexes/etc, multiple 'views' per dbml diagram etc.

like image 35
KristoferA Avatar answered Sep 21 '22 08:09

KristoferA