Question : the database connection in in asp.net

I have built a website using asp.net, I found that i open a new connection to the sql server data for e each page. Is there a way of maintain one or feww connections in the website? is it advisable? what is the best method?

anthony

Answer : the database connection in in asp.net

Keep it how you are so that you create the connection only when you need the data.

I beleive ASP.net uses  ADO.NET Connection Pooling, so when you close the connection, you're not actually closing the connection, you just return connection back to the  pool.

Pooling only works when connections are created using identical connection strings.                                                                            

Or you can look into Data Access Layers etc..

Random Solutions  
 
programming4us programming4us