Welcome to David Sandor Sign in | Join | Help
in Search

Professional Software Architecture

Solved: Connection String does not show up when editing the connection property of a DBML file.

The DBML editor in Visual Studio 2008 tends to create a nasty name in the settings file for your database connection string.  We have our databases named with the associated environment e.g. Product_dev or Product_test.  When the DBML editor saves the connection string you get a nasty name such as: ClassLibrary1.Properties.Settings.Product_devConnectionString.

This is fixed by creating the setting for the connection string first and giving it a pleasant name such as: ProductDb. 

 

Make sure you create the setting of type (Connection String) and save the settings.  After this you will need to edit your .config file and assign a providerName attribute to the connection string that was created.

providerName="System.Data.SqlClient"

 

After this, open your DBML file and your ProductDb connection string will show in the dropdown.

Published Friday, June 26, 2009 1:19 AM by david
Filed under: , , , ,

Comments

No Comments
Anonymous comments are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems