SyntaxFix
Write A Post
Hire A Developer
Questions
You should be using SqlConnection.State
e.g,
using System.Data; if (myConnection != null && myConnection.State == ConnectionState.Closed) { // do something // ... }