SqlDataSource.ConnectionParameters Property
Specifies the data connection settings of the SqlDataSource.
Namespace: DevExpress.DataAccess.Sql
Assembly: DevExpress.DataAccess.v24.1.dll
NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap
Declaration
[LocalizableCategory(DataAccessStringId.PropertyGridConnectionCategoryName)]
[TypeConverter(typeof(SqlDataSource.ConnectionParametersTypeConverter))]
public DataConnectionParametersBase ConnectionParameters { get; set; }
Property Value
Type | Description |
---|---|
DataConnectionParametersBase | A DataConnectionParametersBase descendant that specifies the connection parameters of the SqlDataSource. |
Remarks
The ConnectionParameters property value is a DataConnectionParametersBase descendant. To establish a data connection, create an object of the type appropriate for the data source. For instance, MS SQL Server requires the MsSqlConnectionParameters type, Oracle DB uses the OracleConnectionParameters type, and an XML file utilizes the XmlFileConnectionParameters type.
When the ConnectionParameters property is specified, the SqlDataSource.ConfigureDataConnection event occurs each time the SqlDataSource connects to a database. Handle this event to change parameters required to establish a data connection (the server name, the database name, user credentials, the path to a data file, etc.).
Tip
In a Reporting application, the IConnectionProviderService interface allows you to specify connections for all SqlDataSource instances available for the XtraReport instance. The IConnectionProviderService.LoadConnection method is called for each connection serialized into the report definition file. Use the SqlDataSource.ConnectionName property to distinguish between connections.
Tip
For more information, review the following article: SqlDataSource - How to change connection parameters at runtime.
Related GitHub Examples
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.