Click to See Complete Forum and Search --> : sqlConnection.State.ToString().Equals( "Open" )


dky1e
June 3rd, 2002, 08:34 AM
sqlConnection.State.ToString().Equals( "Open" )

There has to be a cleaner way to check the state of SqlConnection (???)

V. Lorenzo
June 4th, 2002, 07:44 AM
Hi:

Yes!! Of course. Try this:

if (m_Connection.State == ConnectionState.Open)
...do what ever needs to be done if the collection is open...

m_Connection is the instance of the connection class.

VictorL

dky1e
June 4th, 2002, 08:01 AM
Nice...
I knew threre was a better way :)!