Last post Aug 30, 2012 05:48 PM by DominicFinn
Aug 30, 2012 11:59 AM|lionelthomas|LINK
When I configure a Table adapter the wizard uses the connections that are in Database Explorer. But when I configure the ObjectDataSource in a page I want to use Web.config. How can I make the Database Explorer use the connections in Web.config?
Aug 30, 2012 12:44 PM|DominicFinn|LINK
You can't (without some serious messing about).
The database / server explorer uses a config file found in your Visual Studio app data folder....
If you want a database in the explorer you need to add it using the wizard.
Aug 30, 2012 01:07 PM|lionelthomas|LINK
Thanks for the reply'
How do I get my TableAdapters to point to web.config connections?
Aug 30, 2012 05:48 PM|DominicFinn|LINK
Well, I don't use this method of connection normally.
When I created a DataGridView and created a source for it as a DataSet, it automatically created the DataTableAdapter and set the connection string with a name property matching the DataTableAdapter name.
<add name="FormTableAdapter.Properties.Settings.MyConnString" connectionString="" providerName="System.Data.SqlClient" />
So I suppose you can either, try and correctly name the connection string to match the name of your TableAdapter. Or you can just recreate the table adapter again using the wizard if that's what you used in the first place.
Hope that helps.