views:

45

answers:

2

Whenever I use the ORM deisgner in LinqToSql I have real problems trying to get the latest objects from the server explorer after i've updated them in the database.

For example, I have dragged in a stored procedure to handle my insert/updates, which creates the method for me to call. Problem is I then have to go and change one of the parameters of the sp in the database. When I drag the sp back into the designer, my new parameter isn't there. Even after refreshing the server explorer object (db level) it still reverts to the previous parameters. When I look at the parameters in the server explorer it shows my new parameter, but doesn't bring it in when i drag it on.

A work around is to close the whole of VS and then it works. This is obviously not ideal, so any help on this would be great.

thanks.

A: 

We stopped messing with the LinqToSQL designer a long time ago because of the exact problems you're outlining. You can use SqlMetal to generate the DataContext for you from the Visual Studio Command Line (Start > Programs > Visual Studio (2005|2008) > Visual Studio Tools > Visual Studio (2005|2008) Command Prompt)

Jason Punyon
+1  A: 

The bug you've found sounds similar to this one:

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=455456

My best advice is to not use Linq2Sql, especially the O/R Designer. There are many good reasons for that:

Do not use the Visual Studio 2008 LinqToSql O/R Designer

The drawbacks of adopting Linq To Sql

In the end, it's your choice whether you want to continue to work around the issues with Linq2Sql. There are much better alternatives.

Michael Maddox