Back to Devexpress

XPObjectSource.ConnectionStringName Property

xpo-devexpress-dot-xpo-dot-xpobjectsource.md

latest4.7 KB
Original Source

XPObjectSource.ConnectionStringName Property

Specifies the name of the connection string used to connect to a database. The specified name should exist in the application configuration file.

Namespace : DevExpress.Xpo

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
[DefaultValue(null)]
public string ConnectionStringName { get; set; }
vb
<DefaultValue(Nothing)>
Public Property ConnectionStringName As String

Property Value

TypeDefaultDescription
Stringnull

A String specifying the name of a the connection string.

|

Remarks

This property has effect if a Session object is not created in the XPObjectSource.ResolveSession event handler.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ConnectionStringName 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.

asp-net-core-dashboard-register-data-sources/CS/WebDashboardDataSources/Configuration/XpoDataSourceConfigurator.cs#L9

csharp
DashboardXpoDataSource xpoDataSource = new DashboardXpoDataSource("XPO Data Source");
xpoDataSource.ConnectionStringName = "NWindConnectionString";
xpoDataSource.SetEntityType(typeof(Category));

asp-net-web-forms-dashboard-register-data-sources/CS/WebFormsDashboardDataSources/Pages/XpoDashboard.aspx.cs#L19

csharp
DashboardXpoDataSource xpoDataSource = new DashboardXpoDataSource("XPO Data Source");
xpoDataSource.ConnectionStringName = "NWindConnectionStringSQLite";
xpoDataSource.SetEntityType(typeof(Category));

asp-net-mvc-dashboard-register-data-sources/CS/MvcDashboardDataSources/Configuration/XpoDataSourceConfigurator.cs#L9

csharp
DashboardXpoDataSource xpoDataSource = new DashboardXpoDataSource("XPO Data Source");
xpoDataSource.ConnectionStringName = "NWindConnectionStringSQLite";
xpoDataSource.SetEntityType(typeof(Category));

asp-net-web-forms-dashboard-register-data-sources/VB/WebFormsDashboardDataSources/Pages/XpoDashboard.aspx.vb#L19

vb
Dim xpoDataSource As DashboardXpoDataSource = New DashboardXpoDataSource("XPO Data Source")
xpoDataSource.ConnectionStringName = "NWindConnectionStringSQLite"
xpoDataSource.SetEntityType(GetType(Category))

asp-net-mvc-dashboard-register-data-sources/VB/MvcDashboardDataSources/Configuration/XpoDataSourceConfigurator.vb#L9

vb
Dim xpoDataSource As New DashboardXpoDataSource("XPO Data Source")
xpoDataSource.ConnectionStringName = "NWindConnectionStringSQLite"
xpoDataSource.SetEntityType(GetType(Category))

See Also

ConnectionString

XPObjectSource Class

XPObjectSource Members

DevExpress.Xpo Namespace