ADO.NET connection strings are passed into CtreeSqlConnection objects as semicolon-separated Name-Value pairs. The Name portion of the Name-Value pair is not case-sensitive.
The following table lists Name-Value pairs used in connection strings for the FairCom DB SQL ADO.NET Data Provider.
You can use any of the synonyms as a replacement for the Name portion of the pair to remain cross-compatible with usage of other database products. The most common synonyms are shown below.
The minimum required are User ID and Password. If other values are not specified, default values will be assigned as noted.
Name |
Default Value |
Description |
---|---|---|
User ID Synonyms
|
None |
The user name for login. |
Password Synonyms
|
None |
The password for the user. |
Initial Catalog Synonyms
|
ctreeSQL |
The name of the FairCom DB SQL database. |
Data Source Synonyms
|
localhost |
The TCP/IP address of the FairCom DB SQL installation. |
Port Number Synonyms
|
6597 |
The TCP/IP port number used by FairCom DB SQL. |
Pooling |
true |
User client side connection pooling. |
Max Pool Size Synonyms
|
100 |
Maximum number of pooled connections. |
Connection Lifetime Synonyms
|
0 |
|
Connection Timeout Synonyms
|
15 |
Number of seconds a particular connection object waits for an answer from the FairCom DB SQL server. The connection will disconnect after this value has elapsed with no response. |
TCP Keepalive Interval |
0 |
Number of seconds of idle time before sending a TCP level keepalive probe (0 = disabled). If the host does not respond to the keepalive probe within 10 seconds, the connection will be treated as broken. |
Connection Idle Timeout Synonyms
|
0 |
Number of seconds a connection sits idle in the pool before being disposed. If a value is not specified, then all connection objects will stay in the connection pool regardless of use and never be disposed. |
Isolation Level Synonyms
|
ReadCommitted |
The transaction isolation level for the connection. |
ssl |
|
(optional) Values of basic (no peer certificate authentication) or peerAuthentication (server certificate authentication) |
sslcert |
|
Required when peerAuthentication is requested to provide certificate defined server name |
Example
A typical connection string for the FairCom DB ADO.NET Data Provider would be composed of:
"User ID=ADMIN;Password=ADMIN;database=ctreeSQL;server=localhost;port=6597”
A minimal connection string can be:
"User=ADMIN;Password=ADMIN"
TLS/SSL Examples
"UID=ADMIN;PWD=ADMIN;Database=ctreeSQL;Server=localhost;Service=6597;ssl=basic";
"UID=ADMIN;PWD=ADMIN;Database=ctreeSQL;Server=localhost;Service=6597;ssl=peerAuthentication;sslcert=support.faircom.com";
Timeout
The following connection string sets the timeout to never expire. In this example, "Server=faircom2" is a bad server name:
conn.ConnectionString = "ConnectionTimeout=0;UID=ADMIN;PWD=ADMIN;Database=ctreeSQL;Datasource=db1.company.com;Service=6597";
You might expect your ADO.NET application to wait indefinitely before it returns. However, several errors are not affected by the timeout setting in this string, such as:
The actual error returned by the timeout setting in this string is generated only if the server can establish the connection, but, it is very busy or the network is very slow to respond.
In the case above, with a bad server name, an error is returned in 5 seconds. (This value is not configurable in the connect string.)
TCP Keepalive Interval
Enabling a TCP Keepalive provides periodic activity on a link to help achieve 2 goals:1) prevent network hardware from identifying a connection as idle and silently terminatiing it, 2) distinguish between server operations that take a long to respond and broken network links.