Link to home
Start Free TrialLog in
Avatar of f_asmaa
f_asmaa

asked on

SQL server connection

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?
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

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.

Greg
Avatar of f_asmaa
f_asmaa

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial