bool CheckConnectionStatus()
{
String strConnection="/*your connection string here*/";
SqlConnection con = new SqlConnection(strConnection);
if(con.State == ConnectionState.Closed)
{
try
{
con.Open();
con.Close();
}
catch(Exception e)
{
return false;
}
}
else
{
return true;
}
}
C# How to check Remote IP Address from the Local Network
-
12-10-2022 - |
Question
Currently, I'm working on a Windows Based System which uses mySQL as Database. The database can be on a Remote Computer connected to the same Network. My Problem is, how can I check if this Remote Address to be my Database source is existing or currently reachable.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow