Click here to Skip to main content
15,915,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have an asp.net web application and a sql server 2008 R2 database. the application is being used by over than 300 users in the same time, they are retrieving, adding, updating and deleting records simultaneously. The application is opening and closing the connection at each function that executes a query.
I think its wrong to open and close connection for all these times and with that number of users right? but i don't know how to make this better because i'm new with asp.net so can anyone help me and provide me with some better ideas?

Thanks in advance.
Posted

1 solution

As far as I know, there is no any issues with opening and closing the connection. Open it when you need it and close it as soon as you're done with it. Connection pooling will automatically handle the reusing the connection.

http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.90).aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900