Chapter 18. The Connection Class

The Connection class is provided by all standard ADO.NET providers and represents a connection between your code and a data source. Connections require resources, so one hallmark of well-written ADO.NET code is that it opens a connection only when necessary and releases it as soon as possible. The Connection class is provided in several provider-specific varieties, including SqlConnection and OleDbConnection .

Most of the Connection properties are informational and can't be modified directly. Instead, before opening a connection, you use the ConnectionString property to set such information as the location of the data source, the authentication credentials, and the connection timeout. The Connection class is also the heart of client-side transactions with ADO.NET, connection pooling, and schema tables with the OLE DB provider.

ADO. NET in a Nutshell
ADO.NET in a Nutshell
ISBN: 0596003617
EAN: 2147483647
Year: 2005
Pages: 415 © 2008-2017.
If you may any questions please contact us: