SqlCeConnection.State Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets the current state of the connection.

  [Visual Basic]
  Public Overridable ReadOnly Property State As ConnectionState  _
   Implements IDbConnection.State
[C#]
public virtual ConnectionState State {get;}
[C++]
public: __property virtual ConnectionState get_State();
[JScript]
public function get State() : ConnectionState;

Property Value

A bitwise combination of the ConnectionState values. The default is Closed.

Implements

IDbConnection.State

Remarks

The allowed state changes are:

  • From Closed to Open, by using the Open method of the connection object.
  • From Open to Closed, by using either the Close method or the Dispose method of the connection object.

Note   Calling the State property increases application overhead because each call results in a call to the OLE DB DBPROP_CONNECTIONSTATUS property for an open connection.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeConnection Class | SqlCeConnection Members | System.Data.SqlServerCe Namespace

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.