SqlConnection
Represents a connection to a SQL Server database. This class cannot be inherited.
Gets or sets the access token for the connection.
The connection ID of the most recent connection attempt, regardless of whether the attempt succeeded or failed.
Gets or sets the SqlCredential object for this connection.
Gets or sets the FireInfoMessageEventOnUserErrors property.
Gets the size (in bytes) of network packets used to communicate with an instance of SQL Server.
When set to true, enables statistics gathering for the current connection.
Gets a string that identifies the database client.
Occurs when SQL Server returns a warning or informational message.
public SqlConnection()
Initializes a new instance of the SqlConnection class.
Initializes a new instance of the SqlConnection class when given a string that contains the connection string.
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.
public static void ChangePassword(string connectionString, SqlCredential credential, SecureString newPassword)
Changes the SQL Server password for the user indicated in the SqlCredential object.
Changes the SQL Server password for the user indicated in the connection string to the supplied new password.
Empties the connection pool.
Empties the connection pool associated with the specified connection.
Starts a database transaction.
Starts a database transaction with the specified isolation level.
Starts a database transaction with the specified isolation level and transaction name.
Starts a database transaction with the specified transaction name.
Creates and returns a SqlCommand object associated with the SqlConnection.
If statistics gathering is enabled, all values are reset to zero.
Returns a name value pair collection of statistics at the point in time the method is called.