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
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:
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries From Partially Trusted Code
See Also
SqlCeConnection Class | SqlCeConnection Members | System.Data.SqlServerCe Namespace | Close
Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.