The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Session.Connection Property

Gets or sets an IDbConnection object associated with the session.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

[DefaultValue(null)]
public IDbConnection Connection { get; set; }
<DefaultValue(Nothing)>
Public Property Connection As IDbConnection
[DefaultValue(null)]
public IDbConnection Connection { get; set; }
<DefaultValue(Nothing)>
Public Property Connection As IDbConnection

Property Value

Type Default Description
IDbConnection

null

An object which implements the IDbConnection interface.

Property Value

Type Default Description
IDbConnection

null

An object which implements the IDbConnection interface.

Remarks

Use the OleDbConnection to access an MS Access database and the SqlConnection to access an MS SQL Server database.

Setting the Connection property throws the CannotChangePropertyWhenSessionIsConnectedException if the session is already connected to a database. Otherwise, it resets the Session.ConnectionString property's value.

The Connection property returns null (Nothing in VB) if the pooled database connection with the Cached Data Store and Object Access Layer (SessionObjectLayer or SerializableObjectLayerClient) is used.

See Also