Making Connections

Before a program can do anything with a database it must make a connection. A connection is the action that establishes a session with a database. A session is the sequence of actions to view, insert, update, delete, and perform other management commands with a database. When a program is connected, a session begins. Likewise, when a program is disconnected, a session ends.

There is an ADO.NET class that represents a connection. A connection object must be instantiated and opened to establish a database session. Connection objects have attributes that define various aspects of the session being initiated, and these attributes depend upon the requirements of the underlying database. For example, a name and location are required ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.