Choose Category
public int checkConnection() { // Try block with Executable commands try { //Opening Connection con1.Open(); return 1; } // Catch block -For tracking unsuccessful cases catch { return 0; } // Closing connection in 'must be Executed block' finally { con1.Close(); } }