Handling Connections in ASP.NET

  • Thread starter Thread starter yop
  • Start date Start date
Y

yop

Lads

Am using ASP.NET, Framework 1.1
Creating a web application to read details from a MYSQL
database.
Am using the dbProvider to create connection to the DB.
I am having a lot of issues with connection pooling etc.
Also of late getting an error, "Could not initiate
communication with the server" which is strange.

How do you suggest I handle connections? At the moment I
create a new connection in each function in the .VB files
but these connections are been closed and destroyed as I
leave the function.

Is it possible to create a connection once and share it
across all pages/code files?

Thanks
 
Ravikanth

Thanks for that, I presume that this is in the session
object that I do that

Thanks
 
I have the same problem....

I have a web app (upgraded from a traditional client/server app) with a
dozen or so web forms that will be accessed by about a hundred users
(possibly at one time). The number of transactions may be relatively
extensive (no google, but 1000's of reads and writes to the db per day)

What is the preferred/suggested method for the database connection.

COnnection pooling?
Application_OnStart

Currently, I am opening and closing the connection as needed. It is/can be
inefficient at times.

TIA
E
 
Connection Pooling is built into the .Net Framework. It is best to open and
close Connections as quickly as possible. Connection Pooling will take care
of the rest.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 
As long as the Connection String is identical the Connection can be reused
from the Pool. You don't have to think about Connection Pooling otherwise,
as it is automatic.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 
Back
Top