SphinxQLDataReader Class

Reads a forward-only stream of rows from Sphinx. This class cannot be inherited.

Definition

Namespace: SphinxConnector.SphinxQL
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
public sealed class SphinxQLDataReader : DbDataReader
Inheritance
Object    MarshalByRefObject    DbDataReader    SphinxQLDataReader

Example

The following example shows how to read data from Sphinx with the SphinxQLDataReader class.
C#
using (SphinxQLConnection sphinxQLConnection = new SphinxQLConnection("Data Source = localhost;Port=9306"))
{
    SphinxQLCommand sphinxQLCommand = new SphinxQLCommand("SELECT * from sakila;", sphinxQLConnection);

    sphinxQLConnection.Open();

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

Properties

Depth Gets a value indicating the depth of nesting for the current row. Always returns 0.
(Overrides DbDataReaderDepth)
FieldCount Gets the number of columns in the current row.
(Overrides DbDataReaderFieldCount)
HasRows Gets a value that indicates whether this SphinxQLDataReader contains one or more rows.
(Overrides DbDataReaderHasRows)
IsClosed Gets a value indicating whether the SphinxQLDataReader is closed.
(Overrides DbDataReaderIsClosed)
ItemInt32 Gets the Object with the specified ordinal.
(Overrides DbDataReaderItemInt32)
ItemString Gets the Object with the specified name.
(Overrides DbDataReaderItemString)
RecordsAffected Gets the number of rows changed, inserted, or deleted by execution of the SphinxQL statement.
(Overrides DbDataReaderRecordsAffected)
VisibleFieldCountGets the number of fields in the DbDataReader that are not hidden.
(Inherited from DbDataReader)

Methods

Close Closes the SphinxQLDataReader object.
(Overrides DbDataReaderClose)
CloseAsync Asynchronously closes the SphinxQLDataReader object.
(Overrides DbDataReaderCloseAsync)
DisposeReleases all resources used by the current instance of the DbDataReader class.
(Inherited from DbDataReader)
DisposeAsync Asynchronously dispose the SphinxQLDataReader object.
(Overrides DbDataReaderDisposeAsync)
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetBoolean(Int32) Gets the value of the specified column as a Boolean.
(Overrides DbDataReaderGetBoolean(Int32))
GetBoolean(String) Gets the value of the specified column as a Boolean.
GetByte Gets the value of the specified column as a byte.
(Overrides DbDataReaderGetByte(Int32))
GetBytes Reads a stream of bytes from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. Currently not supported.
(Overrides DbDataReaderGetBytes(Int32, Int64, Byte, Int32, Int32))
GetChar(Int32) Gets the value of the specified column as a single character.
(Overrides DbDataReaderGetChar(Int32))
GetChar(String) Gets the value of the specified column as a single character.
GetChars Reads a stream of characters from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. Currently not supported.
(Overrides DbDataReaderGetChars(Int32, Int64, Char, Int32, Int32))
GetColumnSchemaAsyncThis is the asynchronous version of GetColumnSchema(DbDataReader). Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.
(Inherited from DbDataReader)
GetDataReturns a nested data reader for the requested column.
(Inherited from DbDataReader)
GetDataTypeName Gets the name of the data type of the specified column.
(Overrides DbDataReaderGetDataTypeName(Int32))
GetDateTime(Int32) Gets the value of the specified column as a DateTime object.
(Overrides DbDataReaderGetDateTime(Int32))
GetDateTime(String) Gets the value of the specified column as a DateTime object.
GetDecimal(Int32) Gets the value of the specified column as a Decimal object.
(Overrides DbDataReaderGetDecimal(Int32))
GetDecimal(String) Gets the value of the specified column as a Decimal object.
GetDouble(Int32) Gets the value of the specified column as a double-precision floating point number.
(Overrides DbDataReaderGetDouble(Int32))
GetDouble(String) Gets the value of the specified column as a double-precision floating point number.
GetEnumerator Returns an IEnumerator that can be used to iterate through the rows in the data reader.
(Overrides DbDataReader.GetEnumerator)
GetFieldType Gets the data type of the specified column.
(Overrides DbDataReaderGetFieldType(Int32))
GetFieldValueTGets the value of the specified column as the requested type.
(Inherited from DbDataReader)
GetFieldValueAsyncT(Int32)Asynchronously gets the value of the specified column as the requested type.
(Inherited from DbDataReader)
GetFieldValueAsyncT(Int32, CancellationToken)Asynchronously gets the value of the specified column as the requested type.
(Inherited from DbDataReader)
GetFloat(Int32) Gets the value of the specified column as a single-precision floating point number.
(Overrides DbDataReaderGetFloat(Int32))
GetFloat(String) Gets the value of the specified column as a single-precision floating point number.
GetGuid Gets the value of the specified column as a globally-unique identifier (GUID).
(Overrides DbDataReaderGetGuid(Int32))
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetInt16(Int32) Gets the value of the specified column as a 16-bit signed integer.
(Overrides DbDataReaderGetInt16(Int32))
GetInt16(String) Gets the value of the specified column as a 16-bit signed integer.
GetInt32(Int32) Gets the value of the specified column as a 32-bit signed integer.
(Overrides DbDataReaderGetInt32(Int32))
GetInt32(String) Gets the value of the specified column as a 32-bit signed integer.
GetInt64(Int32) Gets the value of the specified column as a 64-bit signed integer.
(Overrides DbDataReaderGetInt64(Int32))
GetInt64(String) Gets the value of the specified column as a 64-bit signed integer.
GetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Obsolete
GetMvaValues(Int32) Gets the values of a multi value attribute.
GetMvaValues(String) Gets the values of a multi value attribute.
GetName Gets the name of the column, given the zero-based column ordinal.
(Overrides DbDataReaderGetName(Int32))
GetOrdinal Gets the column ordinal given the name of the column. This method is case insensitive.
(Overrides DbDataReaderGetOrdinal(String))
GetProviderSpecificFieldTypeGets the provider-specific type of the specified column.
(Inherited from DbDataReader)
GetProviderSpecificValueGets the value of the specified column as an instance of a provider-specific type.
(Inherited from DbDataReader)
GetProviderSpecificValuesGets all provider-specific attribute columns in the collection for the current row.
(Inherited from DbDataReader)
GetSchemaTable Returns a DataTable that describes the column metadata of the SphinxQLDataReader.
(Overrides DbDataReaderGetSchemaTable)
GetSchemaTableAsyncThis is the asynchronous version of GetSchemaTable. Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetSchemaTable call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetSchemaTable will be communicated via the returned Task Exception property.
(Inherited from DbDataReader)
GetSphinxTimestamp(Int32) Gets the value of the specified column as a SphinxTimestamp.
GetSphinxTimestamp(String) Gets the value of the specified column as a SphinxTimestamp.
GetStreamGets a stream to retrieve data from the specified column.
(Inherited from DbDataReader)
GetString(Int32) Gets the value of the specified column as an instance of String.
(Overrides DbDataReaderGetString(Int32))
GetString(String) Gets the value of the specified column as an instance of String.
GetTextReaderGets a text reader to retrieve data from the column.
(Inherited from DbDataReader)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetUInt32(Int32) Gets the value of the specified column as a 32-bit unsigned integer.
GetUInt32(String) Gets the value of the specified column as a 32-bit unsigned integer.
GetUInt64(Int32) Gets the value of the specified column as a 64-bit unsigned integer.
GetUInt64(String) Gets the value of the specified column as a 64-bit unsigned integer.
GetValue(Int32) Gets the value of the specified column as an instance of Object.
(Overrides DbDataReaderGetValue(Int32))
GetValue(String) Gets the value of the specified column as an instance of Object.
GetValues Gets all attribute columns in the collection for the current row.
(Overrides DbDataReaderGetValues(Object))
InitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject)
Obsolete
IsDBNull(Int32) Gets a value that indicates whether the column contains nonexistent or missing values.
(Overrides DbDataReaderIsDBNull(Int32))
IsDBNull(String) Gets a value that indicates whether the column contains nonexistent or missing values.
IsDBNullAsync(Int32)Asynchronously gets a value that indicates whether the column contains non-existent or missing values.
(Inherited from DbDataReader)
IsDBNullAsync(Int32, CancellationToken)Asynchronously gets a value that indicates whether the column contains non-existent or missing values.
(Inherited from DbDataReader)
NextResult Asynchronously advances the reader to the next result when reading the results of multiple queries.
(Overrides DbDataReaderNextResult)
NextResultAsyncAsynchronously advances the reader to the next result when reading the results of a batch of statements.
(Inherited from DbDataReader)
NextResultAsync(CancellationToken) Asynchronously advances the reader to the next result when reading the results of multiple queries.
(Overrides DbDataReaderNextResultAsync(CancellationToken))
Read Advances the reader to the next record in a result set.
(Overrides DbDataReaderRead)
ReadAsyncAsynchronously advances the reader to the next record in a result set.
(Inherited from DbDataReader)
ReadAsync(CancellationToken) Asynchronously advances the reader to the next record in a result set.
(Overrides DbDataReaderReadAsync(CancellationToken))
ToStringReturns a string that represents the current object.
(Inherited from Object)

Explicit Interface Implementations

IDataRecordGetDataFor a description of this member, see GetData(Int32).
(Inherited from DbDataReader)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also