Export (0) Print
Expand All

SqlConnection Constructor (String, SqlCredential)

.NET Framework 4.5

Initializes a new instance of the SqlConnection class given a connection string, that does not use Integrated Security = true and a SqlCredential object that contains the user ID and password.

Namespace:  System.Data.SqlClient
Assembly:  System.Data (in System.Data.dll)

public SqlConnection(
	string connectionString,
	SqlCredential credential


Type: System.String

A connection string that does not use any of the following connection string keywords: Integrated Security = true, UserId, or Password; or that does not use ContextConnection = true.

Type: System.Data.SqlClient.SqlCredential

A SqlCredential object. If credential is null, SqlConnection is functionally equivalent to SqlConnection.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft