Atley:
DataSet's don't need or use a Connection for access. The DataAdapter may
use a Connection(if you are using a DataAdapter) to fill your datasets and
get data back to the server, but datasets don't have a connectino property.
Also, you should be able to accomplish most scenarios with only one dataset.
Since I disagree wholeheartedly about leaving a connection open for the life
of the app, I'd recommend storing the connection string somewhere globally
accessible...that would allow you to create connections anywhere with the
same connection string.
HTH,
Bill
[quoted text, click to view] "Atley" <atley_1@hotmail.com> wrote in message
news:#8uLcIF7DHA.2560@TK2MSFTNGP09.phx.gbl...
> Can two different datasets be accessing through one connection at the same
> time?
>
> How would you go about this? just create a global variable for the data
> connection?
>
> Will my application run any quicker?
>
> Thanks for your input.
>
>
> "éric" <eric@westgen.com> wrote in message
> news:eMcJGyE7DHA.1428@TK2MSFTNGP12.phx.gbl...
> > connect once and release when you close the application... that is the
> best
> > way... overhead for keeping connection in memory is less then overheard
of
> > trying to open and close db everytime you want to do something.
> >
> > One note... if you want some other application to use the db you will
have
> > to close and wait then reopen.
> >
> > Regards,
> >
> > éric
> >
> > "Atley" <atley_1@hotmail.com> wrote in message
> > news:u7GzZnE7DHA.3704@tk2msftngp13.phx.gbl...
> > > I have written an application in VB.NET 2003 and I occasionally get
one
> > form
> > > not showing any data, because it is trying to open a connection to the
> > > database before the last form has completely released it's hold on the
> db.
> > >
> > > What is the best way to connect to the database?
> > > Is it better to connect once at the beginning and leave the connection
> > open
> > > through the whole application. Will idividual datasets have problems
> > > running into each other?
> > >
> > > Or is it better to do it the way i have done it, connect only when you
> > need
> > > the data and then close the connection right away.
> > >
> > > Which one is better, why?
> > >
> > > Thanks
> > >
> > >
> >
> >
>
>