one sql connection for multiple web forms

  • Thread starter Thread starter new2.NET
  • Start date Start date
N

new2.NET

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
 
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
 
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
 

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

Back
Top