Corovei Andrei
Corovei Andrei

Reputation: 1668

Verify if a remote server is accessible

How to verify if a remote server is accessible or not?

I want to perform an open query on it, but before I would like to know if the server is online or not in order to generate a message.

Upvotes: 0

Views: 979

Answers (1)

Damith
Damith

Reputation: 63065

Even you check before execute your query it can be unavailable when you calling the method. So what you can do is try to process the task and catch the exception. you can show the message based on the exception.

If you want to check availability of SQL Server check this.

Upvotes: 1

Related Questions