Skip to main content
.NET 6.0+

XafApplication.ConnectionString Property

Specifies the connection string used to connect to the application’s database or to the Application Server.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp


public string ConnectionString { get; set; }

Property Value

Type Description

The connection string.


Your application may have different connection strings for different scenarios (for example, a specific string for each compilation mode). When you create a new XAF application, the Solution Wizard generates the connection strings for Microsoft SQL Server Express LocalDB. To customize the autogenerated connection strings or create a new string, open the application configuration file and navigate to its connectionStrings section. For more information, refer to the following help topic: Connect an XAF Application to a Database Provider.

The XafApplication.ConnectionString property allows you to choose a specific connection string for your application. The following example demonstrates how to specify this property for a WinForms application:

static class Program {
   static void Main() {
      MySolutionWindowsFormsApplication application = new MySolutionWindowsFormsApplication();
      application.ConnectionString = 


XAF removes the password from the XafApplication.ConnectionString property value for security reasons (to avoid exposure of sensitive information in logs, errors, and so on). You can access an unmodified connection string in the application configuration file. To do this, use the following API:

The following code snippets (auto-collected from DevExpress Examples) contain references to the ConnectionString property.


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.

See Also