Click or drag to resize

SphinxQLDataReaderNextResult Method

Asynchronously advances the reader to the next result when reading the results of multiple queries.

Namespace:  SphinxConnector.SphinxQL
Assembly:  SphinxConnector (in SphinxConnector.dll) Version: 5.3.0
Syntax
public override bool NextResult()

Return Value

Type: Boolean
true if there are more result sets; otherwise false.
A task representing the asynchronous operation.

Implements

IDataReaderNextResult
Exceptions
ExceptionCondition
SphinxQLException
Examples
using (SphinxQLConnection connection = new SphinxQLConnection())
{
    SphinxQLCommand command = new SphinxQLCommand(connection);
    command.CommandText = @"SELECT * from sakila WHERE MATCH(@match1);
                            SELECT * from sakila WHERE MATCH(@match2)";

    command.Parameters.Add("@match1", "room");
    command.Parameters.Add("@match2", "amazing");

    connection.Open();

    using (SphinxQLDataReader dataReader = command.ExecuteReader())
    {
        while (dataReader.Read())
        {
            Console.WriteLine(dataReader.GetInt64("id"));
        }

        dataReader.NextResult();

        while (dataReader.Read())
        {
            Console.WriteLine(dataReader.GetInt64("id"));
        }
    }
}
See Also