SqlConnection Class

System.Data.SqlClient
Represents an open connection to a SQL Server data source.
Inheritance: Object > MarshalByRefObject > DbConnection > SqlConnection

Syntax

public sealed class SqlConnection : DbConnection

Remarks

The SqlConnection class is used to establish a connection to a Microsoft SQL Server database. You can use it to execute commands and retrieve data from the database.

The ConnectionString property specifies the source of data to which the user is to be connected. It is a string that includes various attributes, such as the server name, database name, and authentication details.

For more information on connection strings, refer to the official SQL Server documentation.

🛠️

Constructors

🗄️

Properties

⚙️

Methods

📢

Events