Archives
-
Connection strings in LINQ to SQL classes.
Version : VS 2008 RTW
When you have a team working on a project that contains a LINQ to SQL class (dbml), you might see the following message when trying to add a Table entity or stored procedure in a dbml created by a fellow developer:
The objects you are adding to the designer use a different data connection than the designer is currently using. Do you want to replace the connection used by the designer?
The reason this happens is because the connection string in Server Explorer used to add the new stored procedure is different from what was originally used. In a team environment, this will occur if one developer checks in the dbml using one connection string and another developer checks out the dbml and tries to add a stored procedure or a table using a different connection string. Connection strings generally fall into one of the two shown below for SQL server: