corelibraries-devexpress-dot-dataaccess-dot-sql-dot-configuredataconnectioneventargs.md
Gets or sets parameters used to establish a connection to data.
Namespace : DevExpress.DataAccess.Sql
Assembly : DevExpress.DataAccess.v25.2.dll
NuGet Package : DevExpress.DataAccess
public DataConnectionParametersBase ConnectionParameters { get; set; }
Public Property ConnectionParameters As DataConnectionParametersBase
| Type | Description |
|---|---|
| DataConnectionParametersBase |
A DataConnectionParametersBase descendant that contains parameters used to establish a connection to data.
|
The ConnectionParameters property specifies a DataConnectionParametersBase descendant that provides parameters required to establish a connection to data (for instance, the server name, the database name, user credentials, the path to a data file, etc).
Different DataConnectionParametersBase descendants provide connection parameters for different DBMS and data file formats. For instance, MsSqlConnectionParameters, OracleConnectionParameters, XmlFileConnectionParameters and many other classes are available.
To edit the current connection parameters, cast the returned DataConnectionParametersBase object to an appropriate descending type and then adjust the parameters. To change the data provider, create an object of an appropriate descending type, customize the parameters and assign the created object to the ConnectionParameters property.
The following code snippets (auto-collected from DevExpress Examples) contain references to the ConnectionParameters 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.
extractParams.FileName = HostingEnvironment.MapPath(@"~/App_Data/SalesPersonExtract.dat");
e.ConnectionParameters = extractParams;
}
+ "Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100;";
e.ConnectionParameters = olapParams;
}
var excelParams = new ExcelDataSourceConnectionParameters(HostingEnvironment.MapPath(@"~/App_Data/Sales.xlsx"));
e.ConnectionParameters = excelParams;
}
jsonParams.JsonSource = new UriJsonSource(fileUri);
e.ConnectionParameters = jsonParams;
}
dashboard-blazor-server-js-customization/CS/BlazorDashboardApp/Code/DashboardUtils.cs#L20
jsonParams.JsonSource = new UriJsonSource(fileUri);
e.ConnectionParameters = jsonParams;
}
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" & "Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100;"
e.ConnectionParameters = olapParams
End If
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" & "Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100;"
e.ConnectionParameters = olapParams
End If
If e.ConnectionName = "Northwind connection" Then
e.ConnectionParameters = New Access97ConnectionParameters(databasePath, "", "")
End If
WebFormsDashboardConfigurator/VB/WebFormsDashboardConfigurator/Global.asax.vb#L42
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" & "Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100;"
e.ConnectionParameters = olapParams
End If
winforms-dashboard-viewer-default-parameter-values/VB/WinViewer_DefaultParameterValues/Form1.vb#L25
If e.DataSourceName = "SQL Data Source 1" Then
e.ConnectionParameters = New Access97ConnectionParameters("..\..\Data\nwind.mdb", "", "")
End If
See Also
ConfigureDataConnectionEventArgs Class