Skip to main content

MsSqlConnectionParameters Class

Contains parameters used to establish a connection to a Microsoft SQL Server.

Namespace: DevExpress.DataAccess.ConnectionParameters

Assembly: DevExpress.DataAccess.v24.2.dll

Declaration

public class MsSqlConnectionParameters :
    SqlServerConnectionParametersBase,
    IConnectionPageEncryption,
    IConnectionPageMsSqlDb

Remarks

The MsSqlConnectionParameters class includes the basic parameters needed to establish connection to the Microsoft SQL Server.

The following code snippet specifies connection parameters:

using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
// ...
MsSqlConnectionParameters connectionParameters = new MsSqlConnectionParameters(){
    ServerName = "localhost",
    DatabaseName = "Northwind",
    UserName = "username",
    Password = "password",
    AuthorizationType = MsSqlAuthorizationType.SqlServer,
    TrustServerCertificate = DevExpress.Utils.DefaultBoolean.True,
    Encrypt = DevExpress.Utils.DefaultBoolean.True
};
SqlDataSource ds = new SqlDataSource();
ds.ConnectionName = "nwindConnection";
ds.ConnectionParameters = connectionParameters;

For more information, review the following help topic: Specify Data Connection.

See Also