SqlConnection

SqlConnection

Namespace:
System.Data.SqlClient
Assembly:
System.Data.SqlClient (4.0.30319)
Class Overview:
The SqlConnection class represents a connection to a SQL Server database. It provides methods for opening and closing the connection, executing SQL statements, and managing the connection state.
Properties:
ConnectionString
Specifies the connection string that identifies the database to which the connection is made.
State
Indicates the current state of the connection.
Open
Opens the connection to the database.
Close
Closes the connection to the database.
Methods:
Open()
Opens the connection to the database.
Close()
Closes the connection to the database.
Execute()
Executes a SQL command.
Execute()
Executes a SQL command.
See Also:
  • SqlDataReader
  • SqlCommand
  • SqlTransaction