Gets or sets the string used to open the connection.
Namespace: Gronewold.SphinxConnector.SphinxQLAssembly: Gronewold.SphinxConnector (in Gronewold.SphinxConnector.dll) Version: 2.8.0.26312 (2.8.0.26312)
Syntax
| C# |
|---|
public override string ConnectionString { get; set; } |
| Visual Basic |
|---|
Public Overrides Property ConnectionString As String Get Set |
Field Value
Return Value
The connection string used to establish the initial connection. The default value is an empty string.Implements
IDbConnection..::..ConnectionString
Remarks
An empty connection string will cause the default values to be used.
- Connection string options must be seperated by a semicolon (;).
- Connection string options are not case sensitive.
- If an option appears several times, the last value will be used.
| Keyword | Default | Description |
|---|---|---|
| Datasource -or- Data Source -or- Host | localhost | Specifies the name of the host or the IP address to connect to. |
| Port | 9306 | Specifies to which port on the host to connect to. |
| Pooling | 'false' | Indicates whether to enable pooling of SphinxQL connections. Note that pooling will only work with Sphinx 1.10.1 and above. Also make sure that the workers option in your sphinx.conf is not set to none. |
| Min Pool Size -or- MinPoolSize | 0 | Specifies the mininum number of connections which should be created upon initialization of the connection pool. |
| Max Pool Size -or- MaxPoolSize | 20 | Specifies the maxinum number of connections allowed a connection pool. If this number is reached and all connections are in use, an exception is thrown. |
| Connection Timeout -or- Connect Timeout | 15 | Specifies the time (in seconds) to wait while establishing a connection before terminating the attempt and generating an error. |
| Enlist | true | Specifies whether connections should automatically enlist in an ambient Transaction. |
| Supports Ping -or- SupportsPing | false | Specifies whether the version of Sphinx to connect to supports the ping command. As of revision 2312 of Sphinx 1.10.1 the ping command is officially supported. This is detected automatically by SphinxConnector.NET and this option will be ignored in that case. |
| Encoding | utf-8 | Specifies the encoding to use when sending queries or retrieving results from Sphinx. |
Exceptions
| Exception | Condition |
|---|---|
| System..::..InvalidOperationException | Occurs when trying to change the connection string of an open connection. |