SQL server connection

Posted on 2005-04-21
Medium Priority
Last Modified: 2010-04-23
I have an application that connect to SQL server database using the following connection string

workstation id=ABC;packet size=4096;user id=XYZ;password=pass;data source=xx.xx.xx.xx;persist security info=False;initial catalog=MyDB;Language=arabic

If connection fail I display a message "Service not available" when the user press a button that connects to my database.

My problem is that when internet goes down and come back again, the message is displayed many when the user presses the button. After many rials the application connect to the database. Please note that I could open websites using IE on the same machine at the time my application displays "Service not available".

It seems to me as the application cash the status of the connection and I have to referesh it. How can I do this?
Question by:f_asmaa
  • 2
LVL 37

Expert Comment

ID: 13838517
the connection pool is maintaining multiple connections for you ... even when you close them they remain open ... they are not realizing that they are dead.

check the status of the connection, I would be intrested in seeing what it comes up as.


Author Comment

ID: 13852770
How can I check the status of the connection?

I foregot to mention that I am using the connection timeout in my connection string, the complete connection string is

workstation id=ABC;packet size=4096;user id=XYZ;password=pass;data source=xx.xx.xx.xx;persist security info=False;initial catalog=MyDB;Language=arabic;connection timeout=4
LVL 37

Accepted Solution

gregoryyoung earned 2000 total points
ID: 13854153
connection.Status I believe

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question