12.3. Connections

A connection is the first thing we need to access a data store. Both managed providers implement the IDbConnection interface and inherit the following properties and methods.

  • ConnectionString This property (of a String type) specifies the string used to open a connection to a data store.

  • ConnectionTimeout This property (of an Integer type) specifies the time to wait while trying to establish a connection before terminating the attempt and generating an error. The default value is 15 seconds.

  • Database This property (of a String type) specifies the name of the current database or the database to be used once a connection is open.

  • State This property returns the current state of the connection. It is of the ConnectionState type ...

Get A Programmer's Guide to .NET 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.