Results 1 to 5 of 5

Thread: How to check if the server is available!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    5

    How to check if the server is available!!

    Hi People

    In my application I should connecto to SQL Server first. therefore, I would like to know how to check if the SQL Server is online or no. in other words, when I click connecto to the server button I should check if the server is available or no.
    Please can someone tell me how

    Thanks
    Eteleeb

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: How to check if the server is available!!

    Quote Originally Posted by Eteleeb
    Hi People

    In my application I should connecto to SQL Server first. therefore, I would like to know how to check if the SQL Server is online or no. in other words, when I click connecto to the server button I should check if the server is available or no.
    Please can someone tell me how

    Thanks
    Eteleeb
    If you are using VB6 then use On Error Go to Error handler to catch error, if .net then use Try Catch to catch any error and if any error occurs that means Server is not available.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    5

    Re: How to check if the server is available!!

    Yes that's true but what I want to do is making connection only to the server without mentioning the database name or the uid or password in my connection string. can you please tell how the connection string will look like?

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: How to check if the server is available!!

    Eteleeb,

    You are asking for two seperate issues. Connecting to a database is not the same as connecting to a server. The database may be on a server, but so may other apps. There is no connection string to connect to a server, only to a database.

    You can see if a server is up by pinging it (if allowed) or by checking an app or file on it (which in essense is a connection).

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    5

    Re: How to check if the server is available!!

    Thank you guys for explainig things. now it is clear and I got it.

    I really appreciate that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width