 | SphinxQLDataReaderNextResultAsync Method (CancellationToken) |
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.4.1
Syntaxpublic override Task<bool> NextResultAsync(
CancellationToken cancellationToken
)
Public Overrides Function NextResultAsync (
cancellationToken As CancellationToken
) As Task(Of Boolean)
Parameters
- cancellationToken
- Type: System.ThreadingCancellationToken
The token to monitor for cancellation requests.
Return Value
Type:
TaskBoolean
true if there are more result sets; otherwise false.
A task representing the asynchronous operation.
Exceptions
Examplesusing (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");
await connection.OpenAsync();
using (SphinxQLDataReader dataReader = await command.ExecuteReaderAsync())
{
while (await dataReader.ReadAsync())
{
Console.WriteLine(dataReader.GetInt64("id"));
}
await dataReader.NextResultAsync();
while (await dataReader.ReadAsync())
{
Console.WriteLine(dataReader.GetInt64("id"));
}
}
}
See Also