ConnectionStringConfiguratorNamed Method

Use the connection string with the given name from the app.config file.

Definition

Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
public void Named(
	string connectionStringName
)

Parameters

connectionStringName  String
The name of the connection string in the app.config file.

Example

Suppose your app.config looks like this:
C#
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="SphinxConnectionString" connectionString="datasource=192.168.105;port=9306"/>
    </connectionStrings>  
</configuration>

You can then configure the FulltextStore class to use that connection string like this:
C#
IFulltextStore fulltextStore = new FulltextStore().Initialize();
fulltextStore.ConnectionString.Named("SphinxConnectionString");

Exceptions

ArgumentNullExceptionOccurs when the provided string is null.
ArgumentExceptionOccurs when the provided string is empty.
InvalidOperationExceptionOccurs in case the connection string has already been set.

See Also