Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SqlConnection Constructor (String^, SqlCredential^)

.NET Framework (current version)
 

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
)

Parameters

connectionString
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.

credential
Type: System.Data.SqlClient::SqlCredential^

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

.NET Framework
Available since 4.5
Return to top
Show:
© 2017 Microsoft