How to change ConnectionString for DataSet at runtime?

W

wilson

Hi. I'm new in VB.NET. I would like to ask a question.
How to change ConnectionString for DataSet at runtime?
Because I want to change the dBase data file directory according to the
program installed directory of user choice.
The DataSet is created using wizard at design-time.

Thanks for your help.
 
J

Jerry H.

A few things:

Datasets don't have connection strings, connection objects do.
Datasets can contain table adapters, which in turn can have connection
objects associated with them.

You need only to change the ConnectionString property of the connection
object that is used to fill your dataset.
 
W

wilson

Let me try. Thank you.
A few things:

Datasets don't have connection strings, connection objects do.
Datasets can contain table adapters, which in turn can have connection
objects associated with them.

You need only to change the ConnectionString property of the
connection object that is used to fill your dataset.



--
 

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