C# ADO.NET Connection

The Connection Object is a part of ADO.NET Data Provider and it is a unique session with the Data Source. The Connection Object is Handling the part of physical communication between the C# application and the Data Source.

The Connection Object connect to the specified Data Source and open a connection between the C# application and the Data Source, depends on the parameter specified in the Connection String . When the connection is established, SQL Commands will execute with the help of the Connection Object and retrieve or manipulate data in the Data Source.

Once the Database activity is over , Connection should be closed and release the Data Source resources.

csharp-connection

In C# the type of the Connection is depend on which Data Source system you are working with. The following are the commonly used Connections from the C# applications.

C# SQL Server Connection

C# OLEDB Connection

C# ODBC Connection