This documentation is archived and is not being maintained.

SqlCeConnection Class

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

Represents an open connection to a data source.

For a list of all members of this type, see SqlCeConnection Members.


[Visual Basic]
NotInheritable Public Class SqlCeConnection
   Inherits MarshalByRefObject
   Implements IDbConnection, IDisposable
public sealed class SqlCeConnection : MarshalByRefObject,
   IDbConnection, IDisposable
public __gc __sealed class SqlCeConnection : public
   MarshalByRefObject, IDbConnection, IDisposable
public class SqlCeConnection extends MarshalByRefObject implements
   IDbConnection, IDisposable

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


A SqlCeConnection object represents a unique connection to a data source. When you create an instance of SqlCeConnection, all properties are set to their initial values. For a list of these values, see the SqlCeConnection constructor.

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

Although SQL Server CE only supports one connection at a time, multiple commands can share the same connection. This means that it is possible to have multiple instances of SqlCeDataReader open on the same connection. This behavior differs from that of System.Data.SqlClient.

If a fatal SqlCeException is generated by the method executing a SqlCeCommand, the SqlCeConnection may be closed. You can reopen the connection and continue.


Namespace: System.Data.SqlServerCe

Platforms: .NET Compact Framework

Assembly: System.Data.Sqlserverce (in System.Data.Sqlserverce.dll)

See Also

SqlCeConnection Members | System.Data.SqlServerCe Namespace | SqlCeDataAdapter | SqlCeCommand