The Virtuoso ADO.NET Provider
ConnectionString property implements the
IDbConnection.ConnectionString property to get or set the string used to open a Virtuoso database connection, and includes the source database name and other parameters needed to establish the initial connection.
The default value is an empty string.
ConnectionStringhas the following syntax. Each connection string is a sequence of settings Individual settings are separated by semicolons. Each setting is a pair of name and value delimited by the equal sign. Whitespace is ignored on either side of both names and values. Names are case insensitive. The value part can be quoted by either single or double quote characters or remain unquoted at all. However if it includes a semicolon, single quote, or double quote characters, it must be enclosed in either type of quotes. To embed the same character that is used for enclosing the value the character within the value must be doubled.
The following table lists the valid names for values within the
| || ||The number of seconds to wait for a connection to the server before terminating the attempt and generating an error.|
| || ||When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by connection lifetime. Useful in clustered configurations to force load balancing between a running server and a server just brought on-line.|
| || || Specifies the character set to be used by the provider when passing string values to and from the database. Must be set to |
| ||The name or network address of the instance of Virtuoso server to which to connect. Can take comma delimited list of instances for connection fail over.|
| || ||Specifies if the connection must be SSL encrypted. Currently encryption only works with an ODBC-based provider.|
| || ||When true, the pooler automatically enlists the connection in the creation thread's current transaction context.|
| ||The name of the database.|
| || ||The maximum number of connections allowed in the pool.|
| || ||The minimum number of connections allowed in the pool.|
| ||The password for the Virtuoso account logging on.|
| || ||When set to 'false', security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open State. Resetting the connection string resets all connection string values including the password.|
| || || When true, the |
| || ||Enables load balancing in which case the server for the connection is chosen at random from the comma delimited provided as for a Failover connection.|
| ||The Virtuoso login name.|
ConnectionString is similar to an OLE DB connection string, but is not identical.
Unlike OLE DB or ADO, the connection string that is returned is the same as the user set
ConnectionString minus security information if the
Persist Security Info value is set to
The Virtuoso ADO.NET Data Provider neither persists nor returns the password in a connection string unless you set
Persist Security Info to
ConnectionString property can be set only when the connection is closed.
Many of the connection string values have corresponding read-only properties.
When the connection string is set, all of these properties are updated, except when an error is detected; in this case, none of the properties are updated.
VirtuosoConnection properties return only those settings contained in the
ConnectionString on a closed connection resets all connection string values (and related properties) including the password.
For example, if you set a connection string that includes "
Database=Demo", and then reset the connection string to "
Data Source=myserver;User ID=dba;Password=dba", the Database property is no longer set to
The connection string is parsed immediately after being set.
If errors in syntax are found when parsing, a runtime exception (e.g.,
ArgumentException) is generated.
Other errors can be found only when an attempt is made to open the connection.