.NET Core 3.0+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

XafApplication.Connection Property

Specifies the connection to the database used by the application.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll


public IDbConnection Connection { get; set; }
Public Property Connection As IDbConnection

Property Value

Type Description

A IDbConnection object representing an open connection to a data source.


To set the appropriate connection, we recommend that you use the Application Designer's Connection section. Via this section, you can both set the required connection and specify the corresponding connection string. If you need to specify the Connection property in code, do it between the XafApplication object's creation and setup:

static void Main() {
   MySolutionWindowsFormsApplication application = new MySolutionWindowsFormsApplication();
   application.Connection = new OracleConnection(...);

By default, SQL connection is used.

See Also