views:

22

answers:

2

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

A: 

I don't believe you can. You cannot drag and drop properties in the L2S DBML designer and cut/paste always pastes the property at the end. The only way I know to do it is to rearrange your columns in the underlying table and then drop and re-add the table to the designer.

Randy Minder
A: 

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'). Then save the dbml file, switch back to the visual designer, make some minor change, and save again to force code-regeneration. The visual designer 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 and VS2010....also has an option to keep the column order in sync...

KristoferA - Huagati.com