Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LINQ and Stored procedures DBML updating problem

I am having serious frustration with DBML files not updating when I alter my stored procedures.

This is what happens. I alter my stored procedure. I then delete the stored procedure from the .DBML file and re-add it. It updates correctly in the .DBML file but the .designer.cs file does not get updated. The only workaround I have found is to delete the stored procedure, then delete the table that the stored procedure returns, add the table then add the stored procedure (all in the .DBML file). And this only sometimes does the trick.

Has anyone else had this problem? Surely there is a more suitable way to update DBML files in Visual Studio 2008?

Thanks in advance

like image 248
Peuge Avatar asked Jan 24 '11 09:01

Peuge


1 Answers

There is no way DBML file gets updated as and when you change the SP.

I have a suggestion for you to get rid of it. This is what we followed in our projects.

Whenever you have update in your SP whether it is input or output parameters. Edit the dbml file as xml file (you can use open as xml in VS only) and save the dbml file. That will automatically updates the changes in designer.cs file as well. In this way you dont have to delete the SP from dbml and re-add it to get the updates. Though this is manual process but it really helps you a lot.

This way you can even modify the entity names (to comply with your entity naming conventions) for the output you are getting from SP as those default names are same as the SP name.

like image 129
JPReddy Avatar answered Oct 19 '22 23:10

JPReddy