Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i change order of properties in DBML file (L2S)

How do i change order of properties in DBML file (L2S) I really do not want delete and then re-drop my table from database

like image 707
Sasha Avatar asked Feb 10 '10 17:02

Sasha


People also ask

How do I view a table in Dbml?

One thing you can do is go to the Properties window (while you have your DBML file open), and select the class generated for the table you're interested in from the dropdown list at the top of the Properties window. Doing so should focus the DBML file visual designer on that table corresponding to that class.

Where is Dbml file located?

dbml file will be added under App_Code folder. Expand Server Explorer and Right click on the Data Connections and select the option Add Connection. Add Connection Pop up will be opened, give the SQL Server details and select the then click on OK button. Database will be added under Data Connections as shown below.


1 Answers

You can do that by editing the dbml file in an xml editor (right-click on the dbml file in the solution explorer, select 'open with...', and then 'xml editor'). Rearrange the properties in the xml editor, then save the dbml file, switch back to the visual designer, make some minor change (e.g. layout change), and save again to force code-regeneration. The visual designer itself don't let you to rearrange columns in an easy manner.

If you're looking for a way to keep your properties in the same order as the db columns with minimal effort, take a look at my add-in; it adds full sync capability to the L2S designer in VS2008, VS2010, VS2012, and VS2013. It also has an option to keep the column order in sync between the database and L2S DBML file.

like image 52
KristoferA Avatar answered Nov 11 '22 05:11

KristoferA