Friday, June 27, 2008

VS 2005: DataSet Designer Gives Unable To Find Connection Error

Symptom/ Situation:

You are using Microsoft Visual Studio 2005, and you have moved a DataSet (.xsd file set) from one location to another in your project on your Visual Studio 2005 and you get this kind of an error any time you want to add or modify a query in the Table Adapter, and you cannot add, delete, edit or modify the query that was previously defined.

Unable to find connection 'db1ConnectionString (MySettings)1' for object 'MySettings'. The connection string could not be found in application settings, or the data provider associated with the connection string could not be loaded. "

Possible Fix:

I had this issue and found out how to fix this in my case. Your case may vary.
  • In the DataSet Designer mode click over the heading of the TableAdapter part and reveal its property.
  • In the properties panel (usually on your right) you will see +Connection.
  • Press the + icon
  • Click the Value part of the connection and a pull-down menu will appear. (Re)select the proper connection string
  • Now you should be able to modify the queries

No comments: