Hello,

I am learning ADO.NET, so please bear with me.
Currently, I am coding in VB.NET and running a SQL Server
2000. My question is this, how do I use only one
SQLConnection for multiple web forms? Is this even
possible?

Thanks in advance,
-new2.NET

RE: one sql connection for multiple web forms by KerryMoorman

KerryMoorman
Thu Feb 17 13:31:05 CST 2005

new2.Net,

Its possible, but not usually advisable.

Hanging onto an open connection will keep your app from scaling. After all,
there are only so many connections to go around, and each one uses resources
on the server.

Instead, get a connection right before you need it, use it, and then close
the connection as soon as possible.

ADO.Net will keep a pool of connections that your app will use.

Kerry Moorman


"new2.NET" wrote:

> Hello,
>
> I am learning ADO.NET, so please bear with me.
> Currently, I am coding in VB.NET and running a SQL Server
> 2000. My question is this, how do I use only one
> SQLConnection for multiple web forms? Is this even
> possible?
>
> Thanks in advance,
> -new2.NET
>

Re: one sql connection for multiple web forms by Cor

Cor
Thu Feb 17 13:34:48 CST 2005

>
> I am learning ADO.NET, so please bear with me.
> Currently, I am coding in VB.NET and running a SQL Server
> 2000. My question is this, how do I use only one
> SQLConnection for multiple web forms? Is this even
> possible?
>

Why?

Beside that every datareader or whatever needs his own connection.

Cor



Re: one sql connection for multiple web forms by Sahil

Sahil
Thu Feb 17 13:47:31 CST 2005

You don't need to and you shouldn't either. ADO.NET does all this under the
seams using connection pooling. Just keep creating new instances of the
SqlConnection object.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/



"new2.NET" <anonymous@discussions.microsoft.com> wrote in message
news:005b01c51525$5ed0c280$a501280a@phx.gbl...
> Hello,
>
> I am learning ADO.NET, so please bear with me.
> Currently, I am coding in VB.NET and running a SQL Server
> 2000. My question is this, how do I use only one
> SQLConnection for multiple web forms? Is this even
> possible?
>
> Thanks in advance,
> -new2.NET