State property

Returns the current state of the connection.

Syntax
Visual Basic

Public Overrides Readonly Property State As ConnectionState
C#

public override ConnectionState State  { get;}
Property value

System.Data.ConnectionState.Open if the connection is open, System.Data.ConnectionState.Closed if the connection is closed.

See also