expressappframework-devexpress-dot-expressapp-dot-xafapplication-ea9f892b.md
Specifies the connection to the database used by the application.
Namespace : DevExpress.ExpressApp
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
[Browsable(false)]
public IDbConnection Connection { get; set; }
<Browsable(False)>
Public Property Connection As IDbConnection
| Type | Description |
|---|---|
| IDbConnection |
A IDbConnection object representing an open connection to a data source.
|
To set the appropriate connection, specify the Connection property in code between the XafApplication object’s creation and setup:
static void Main() {
//...
MySolutionWindowsFormsApplication application = new MySolutionWindowsFormsApplication();
application.Connection = new OracleConnection(...);
application.Setup();
//...
}
By default, SQL connection is used.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Connection property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
xaf-how-to-import-data-in-xaf/CS/WinWebSolution.Web/ApplicationCode/WebApplication.cs#L67
this.ApplicationName = "WinWebSolution";
this.Connection = this.sqlConnection1;
this.Modules.Add(this.module1);
xaf-how-to-create-information-panels/CS/InfoPanels.Web/WebApplication.cs#L68
this.ApplicationName = "InfoPanels";
this.Connection = this.sqlConnection1;
this.Modules.Add(this.module1);
this.ApplicationName = "CustomSecurityOperation";
this.Connection = this.sqlConnection1;
this.Modules.Add(this.module1);
this.ApplicationName = "E689";
this.Connection = this.sqlConnection1;
this.Modules.Add(this.module1);
xaf-how-to-access-a-tab-control-in-a-detail-view-layout/CS/E372.Web/WebApplication.cs#L58
this.ApplicationName = "E372";
this.Connection = this.sqlConnection1;
this.Modules.Add(this.module1);
xaf-how-to-import-data-in-xaf/VB/WinWebSolution.Web/ApplicationCode/WebApplication.vb#L69
Me.ApplicationName = "WinWebSolution"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.ApplicationName = "CustomFunctionCriteriaOperator"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
xaf-how-to-create-information-panels/VB/InfoPanels.Web/WebApplication.vb#L59
Me.ApplicationName = "InfoPanels"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.ApplicationName = "CustomSecurityOperation"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.ApplicationName = "E689"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
See Also