I have a C#.net 2010 web form application that I need to add two tables to the database. This application uses linq to sql. Can you tell me if I want to add these two new tables to the sql server 2008 r2 database, do I
1. Need to remove the original .dbml file and recreate the .dbml file?
2. I would think I can just add two tables to the database and somehow refresh the existing .dbml file. If this possible?
Whatever your answer is to the question, can you tell me how to solve this problem?
Loading
Jignesh TrivediPosted Jun 4, 2012, 11:26 PM
I think you have three way to update dbml.
1) Delete the modified tables from the designer and drag them back onto the designer surface from the Database Explorer.
do this follow the following steps.
a. Refresh the database schema in the Database Explorer by right-click on and click on refresh
b. Save the designer after deleting the tables.
c. Save again after dragging the tables back.
2) Use SQLMetal to regenerate the schema from your database.
http://msdn.microsoft.com/en-us/library/bb386987.aspx
http://www.codeproject.com/Articles/35655/Using-SQLMetal-code-generator-tool-for-LINQ-to-SQL
3) Make changes directly in the Properties pane of the DBML.
Pease refer
http://www.codeproject.com/Articles/37198/SqlMetalPlus-A-VS-Add-in-to-Manage-Custom-Changes
hope this will help u.