SQL server connection

Posted on 2005-04-21
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
    LVL 37

    Expert Comment

    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

    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

    connection.Status I believe

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now