(re)-Setting the connection for a DataSet

  • Thread starter Thread starter John
  • Start date Start date
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?
 
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?
 
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.
 
Back
Top