(re)-Setting the connection for a DataSet

J

John

I have a dataset I've created through the Data/Add New Datasource... menu,
by connecting to a local SS database, which has given me a DataSet and
associated DataTables. This is all well and good for design time, but at run
time I want to override the connection settings for those datatables to
point to whereever the user chooses. The only place the connections are set
are for the tableadapters created for the dataset, and the connection
details are private.

Is there a straightforward way to override the connection details?
 
T

Truong Hong Thi

and the connection
details are private.
The data adapter does not store the connection, the command does.
You can access the connections of commands, like this:
adapter.SelectCommand.Connection.
Same for Update/Delete commands.

Is that what you need?
 
J

John

Truong Hong Thi said:
The data adapter does not store the connection, the command does.
You can access the connections of commands, like this:
adapter.SelectCommand.Connection.
Same for Update/Delete commands.

Is that what you need?

Yes, I think so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top