Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintaining connection to MSSQL 1

Status
Not open for further replies.

haddaway

Programmer
Jul 6, 2005
172
SE
I am facing problems of how to solve an issue. I have an application that is always on in the background. The application call a lot of stored procedures and it's seems costly to connect and disconnect for each question.

Which is the best way to maintain the connection state and connect if needed? I mean, the state can be other than open or closed. Please give me any input on this matter. Thanks.
 
As far as I am aware while the program is running the connection state is active. That is by default you are in a connection pool and thus reduce server load on creating a connection. That is my understanding anyway….
Hope this helps

Age is a consequence of experience
 
So,how do I use it? Do I open it once? And if connection state is closed/inactive I open it again, and the I close it when I close my application?
 
no you should open and close as and when you use it but ADO.NET will keep you a connection to the server.
hope that is more clear?

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top