Home All Groups Group Topic Archive Search About

How to change ConnectionString for DataSet at runtime?

Author
3 Aug 2006 8:38 AM
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.

Author
3 Aug 2006 8:45 AM
ag
u need to create dataset at runtime
Author
3 Aug 2006 8:54 AM
wilson
thank you very much!

ag wrote:

Show quoteHide quote
> u need to create dataset at runtime



--
Author
3 Aug 2006 1:06 PM
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.

wilson wrote:
Show quoteHide quote
> 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.
Author
4 Aug 2006 5:59 AM
wilson
Let me try. Thank you.

Jerry H. wrote:

Show quoteHide quote
> 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.
>
> wilson wrote:
> > 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.



--