tags:

views:

45

answers:

2

Hi All,

I am about to use linqtosql in my first asp.net mvc application. I have come up with a database schema. But the problem is that I may change few of the tables in future. So keeping the model classes in sync with database will be a issue.

I got this link which states the similar situation,

http://stackoverflow.com/questions/914606/keep-linqtosql-sync-with-the-database/914657#914657

My question is, has any body used the third party tools given in the above post, do they work properly

www.huagati.com/dbmltools/

www.perpetuumsoft.com/Product.aspx?lang=en&pid=55&tid=linqtosqlsynchronization

Or is there any better approach for this problem.

A: 

The "official" approach is to simply delete any out of date tables from the designer then drag the updated table from your Server Navigator back on again. I've been using this method for well over a year now and so long as you make your data context changes at the same time you're updating the database you should be OK. It also gives you extra incentive to make sure you have your database structure in order before continuing.

soutarm
A: 

There is also SQLMetal.

http://msdn.microsoft.com/en-us/library/bb386987.aspx

This is whats in our CreateDBML.bat file

call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

sqlmetal /server:{server-name} /user:{username} /password:{password} /database:{databasename}
         /dbml:..\..\Codebase\Domain\CompanyName.ProjectName.Domain\Entities\ProjectName.dbml 
         /namespace:CompanyName.ProjectName.Domain.Entities /pluralize /views 


sqlmetal /code:..\..\Codebase\Domain\CompanyName.ProjectName.Domain\Entities\ProjectName.designer.cs ..\..\Codebase\Domain\CompanyName.ProjectName.Domain\Entities\ProjectName.dbml
pause
Paul Rowland