VirtADONet35ConnStrings Virtuoso ADO.NET Provider ConnectionString Property Virtuoso ADO.NET Provider ConnectionString Property 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. ConnectionString has 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 ConnectionString. <tgroup><thead /><tbody> <row /> <row><entry> <emphasis>Connect Timeout</emphasis> <emphasis>or</emphasis> <emphasis>Connection Timeout</emphasis> </entry><entry> 15 </entry><entry> The number of seconds to wait for a connection to the server before terminating the attempt and generating an error. </entry></row> <row><entry> <emphasis>Connection Lifetime</emphasis> </entry><entry> 0 </entry><entry> 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. </entry></row> <row><entry> <emphasis>Charset</emphasis> </entry><entry> utf-16 </entry><entry> Specifies the character set to be used by the provider when passing string values to and from the database. Must be set to utf-8 to handle Unicode strings passed in SPARQL/SPASQL queries of RDF data. </entry></row> <row><entry> <emphasis>Data Source</emphasis> <emphasis>or</emphasis> <emphasis>Server</emphasis> <emphasis>or</emphasis> <emphasis>Address</emphasis> <emphasis>or</emphasis> <emphasis>Network Address</emphasis> <emphasis>or</emphasis> <emphasis>Host</emphasis> </entry><entry> </entry><entry> 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. </entry></row> <row><entry> <emphasis>Encrypt</emphasis> </entry><entry> false </entry><entry> Specifies if the connection must be SSL encrypted. Currently encryption only works with an ODBC-based provider. </entry></row> <row><entry> <emphasis>Enlist</emphasis> </entry><entry> true </entry><entry> When true, the pooler automatically enlists the connection in the creation thread's current transaction context. </entry></row> <row><entry> <emphasis>Initial Catalog</emphasis> <emphasis>or</emphasis> <emphasis>Database</emphasis> </entry><entry> </entry><entry> The name of the database. </entry></row> <row><entry> <emphasis>Max Pool Size</emphasis> </entry><entry> 100 </entry><entry> The maximum number of connections allowed in the pool. </entry></row> <row><entry> <emphasis>Min Pool Size</emphasis> </entry><entry> 0 </entry><entry> The minimum number of connections allowed in the pool. </entry></row> <row><entry> <emphasis>Password</emphasis> <emphasis>or</emphasis> <emphasis>Pwd</emphasis> </entry><entry> </entry><entry> The password for the Virtuoso account logging on. </entry></row> <row><entry> <emphasis>Persist Security Info</emphasis> </entry><entry> false </entry><entry> 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. </entry></row> <row><entry> <emphasis>Pooling</emphasis> </entry><entry> true </entry><entry> When true, the VirtuosoConnection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool. </entry></row> <row><entry> <emphasis>RoundRobin</emphasis> </entry><entry> false </entry><entry> 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. </entry></row> <row><entry> <emphasis>User ID</emphasis> <emphasis>or</emphasis> <emphasis>Uid</emphasis> </entry><entry> </entry><entry> The Virtuoso login name. </entry></row> </tbody></tgroup></table> <bridgehead class="http://www.w3.org/1999/xhtml:h2"> Remarks</bridgehead> <para>The 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 false (default). The Virtuoso ADO.NET Data Provider neither persists nor returns the password in a connection string unless you set Persist Security Info to true.</para> <para>The 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.</para> <para>Resetting 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 Demo.</para> <para>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.</para> <para><ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryDotNET">CategoryDotNET</ulink> <ulink url="CategoryEntityFrameworks">CategoryEntityFrameworks</ulink> <ulink url="CategoryWebSite">CategoryWebSite</ulink></para> <para> </para> </section></docbook>