asp.net.ph

SqlConnection.State Property

System.Data.SqlClient Namespace   SqlConnection Class


Returns the current state of the connection.

Syntax


Script [ ConnectionState variable = ] SqlConnection.State

Property Value


variable Returns a bitwise combination of the ConnectionState values.

The property is read only with a default value of Closed.

Remarks

The allowed state changes are:


Example

The following example shows the simplest way to retrieve and display the State property of the current connection.

"Connection State: " + myConn.State.ToString ( );
  C# VB

 Show me 

See Also

SqlConnection Members Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note