SqlCeConnection.Open Method

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

Opens a database connection with the property settings specified by the ConnectionString.

  [Visual Basic]
  Public Overridable Sub Open() Implements IDbConnection.Open

  [C#]
  public virtual void Open();
[C++]
public: virtual void Open();
[JScript]
public function Open();

Implements

IDbConnection.Open

Exceptions

Exception Type Condition
InvalidOperationException The connection is already open.
SqlCeException A connection-level error occurred while opening the connection.

Remarks

This method establishes a new connection to the data source.

Note   If the SqlCeConnection goes out of scope, it is not closed. You must explicitly close the the connection by calling Close or Dispose.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

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

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

Send comments on this topic.

© Microsoft Corporation. All rights reserved.