Handling Connections in ASP.NET

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
 
Y

yop

Ravikanth

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

Thanks
 
E

Eric Fortin

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
 
K

Kevin Spencer

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

Kevin Spencer

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.
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top