How can I prevent 'objects you are adding to the designer use a different data connection...'?

Posted by Timothy Khouri on Stack Overflow See other posts from Stack Overflow or by Timothy Khouri
Published on 2010-05-24T00:33:50Z Indexed on 2010/05/24 1:31 UTC
Read the original article Hit count: 465

I am using Visual Studio 2010, and I have a LINQ-to-SQL DBML file that my colleagues and I are using for this project.

We have a connection string in the web.config file that the DBML is using. However, when I drag a new table from my "Server Explorer" onto the DBML file... I get presented with a dialog that demands that do one of these two options:

  1. Allow visual studio to change the connection string to match the one in my solution explorer.
  2. Cancel the operation (meaning, I don't get my table).

I don't really care too much about the debate as why the PMs/devs who made this tool didn't allow a third option - "Create the object anyway - don't worry, I'm a developer!"

What I am thinking would be a good solution is if I can create a connection in the Server Explorer - WITHOUT A WIZARD. If I can just paste a connection string, that would be awesome! Because then the DBML designer won't freak out on me :O)

If anyone knows the answer to this question, or how to do the above, please lemme know!

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about visual-studio-2010