79549710

Date: 2025-04-02 04:58:46
Score: 1.5
Natty:
Report link

Perhaps someone was specifically looking for a check on the connectivity of the connector.

DbConnection contains a State parameter that can be checked for ConnectionState.Open and if it is equal, it will work.

You can also use (try/catch), but the condition is less demanding.

if(con.State== ConnectionState.Open){}

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Валентин Воробьев