Represents a connection to Sphinx. This class cannot be inherited.

Namespace: Gronewold.SphinxConnector.SphinxQL
Assembly: Gronewold.SphinxConnector (in Gronewold.SphinxConnector.dll) Version: 2.7.0.3011 (2.7.0.3011)

Syntax

C#
public sealed class SphinxQLConnection : DbConnection
Visual Basic
Public NotInheritable Class SphinxQLConnection _
	Inherits DbConnection

Remarks

On creation, all properties of the class are set to their initial values. The default ConnectionString is an empty string which is equivalent to "Data Source=localhost;Port=9306;pooling=false;Min Pool Size=5;Max Pool Size=20".

Examples

The following example creates a SphinxQLCommand and a SphinxQLConnection to retrieve data from an index.
CopyC#
string connectionString = "Data Source=localhost;Port=9306;pooling=true";

using (SphinxQLConnection connection = new SphinxQLConnection(connectionString))
{
    SphinxQLCommand sphinxQLCommand = new SphinxQLCommand("SELECT * from sakila;", sphinxQLConnection);

    connection.Open();

    using (SphinxQLDataReader sphinxQLDataReader = sphinxQLCommand.ExecuteReader())
    {
        while(sphinxQLDataReader.Read())
        {
            Console.Writeline(sphinxQLDataReader.GetInt32("id");
        }
    }
}

Inheritance Hierarchy

System..::..Object
  System..::..MarshalByRefObject
    System.ComponentModel..::..Component
      System.Data.Common..::..DbConnection
        Gronewold.SphinxConnector.SphinxQL..::..SphinxQLConnection

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.

See Also