Search Results for

    Show / Hide Table of Contents

    Class MySqlDataReader

    Provides a means of reading a forward-only stream of rows from a MySQL database. This class cannot be inherited.

    Inheritance
    Object
    MarshalByRefObject
    DbDataReader
    MySqlDataReader
    Implements
    IEnumerable
    IAsyncDisposable
    IDataReader
    IDataRecord
    IDisposable
    Namespace: MySql.Data.MySqlClient
    Assembly: MySql.Data.dll
    Version: 8.0.32
    Syntax
    public sealed class MySqlDataReader : DbDataReader, IEnumerable, IAsyncDisposable, IDataReader, IDataRecord, IDisposable
    Remarks

    To create a MySqlDataReader, you must call the ExecuteReader() method of the MySqlCommand object, rather than directly using a constructor.

    While the MySqlDataReader is in use, the associated MySqlConnection is busy serving the MySqlDataReader, and no other operations can be performed on the MySqlConnection other than closing it. This is the case until the Close() method of the MySqlDataReader is called.

    IsClosed and RecordsAffected are the only properties that you can call after the MySqlDataReader is closed. Though the RecordsAffected property may be accessed at any time while the MySqlDataReader exists, always call Close before returning the value of RecordsAffected to ensure an accurate return value.

    For optimal performance, MySqlDataReader avoids creating unnecessary objects or making unnecessary copies of data. As a result, multiple calls to methods such as GetValue(Int32) return a reference to the same object. Use caution if you are modifying the underlying value of the objects returned by methods such as GetValue(Int32).

    Properties

    Depth

    Gets a value indicating the depth of nesting for the current row. This method is not supported currently and always returns 0.

    Declaration
    public override int Depth { get; }
    Property Value
    Type Description
    Int32

    The depth of nesting for the current row.

    Overrides
    DbDataReader.Depth

    FieldCount

    Gets the number of columns in the current row.

    Declaration
    public override int FieldCount { get; }
    Property Value
    Type Description
    Int32

    The number of columns in the current row.

    Overrides
    DbDataReader.FieldCount

    HasRows

    Gets a value indicating whether the MySqlDataReader contains one or more rows.

    Declaration
    public override bool HasRows { get; }
    Property Value
    Type Description
    Boolean

    true if the MySqlDataReader contains one or more rows; otherwise false.

    Overrides
    DbDataReader.HasRows

    IsClosed

    Gets a value indicating whether the data reader is closed.

    Declaration
    public override bool IsClosed { get; }
    Property Value
    Type Description
    Boolean

    true if the MySqlDataReader is closed; otherwise false.

    Overrides
    DbDataReader.IsClosed

    Item[Int32]

    Overloaded. Gets the value of a column in its native format. In C#, this property is the indexer for the MySqlDataReader class.

    Declaration
    public override object this[int i] { get; }
    Parameters
    Type Name Description
    Int32 i
    Property Value
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.Item[Int32]

    Item[String]

    Gets the value of a column in its native format. [C#] In C#, this property is the indexer for the MySqlDataReader class.

    Declaration
    public override object this[string name] { get; }
    Parameters
    Type Name Description
    String name
    Property Value
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.Item[String]

    RecordsAffected

    Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

    Declaration
    public override int RecordsAffected { get; }
    Property Value
    Type Description
    Int32

    The number of rows changed, inserted, or deleted. -1 for SELECT statements; 0 if no rows were affected or the statement failed.

    Overrides
    DbDataReader.RecordsAffected

    Methods

    Close()

    Closes the MySqlDataReader object.

    Declaration
    public override void Close()
    Overrides
    DbDataReader.Close()

    Dispose()

    Releases all resources used by the current instance of the MySqlDataReader class.

    Declaration
    public void Dispose()

    Finalize()

    Declaration
    protected void Finalize()

    GetBodyDefinition(String)

    Gets the body definition of a routine.

    Declaration
    public string GetBodyDefinition(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    String

    The definition of the routine.

    GetBoolean(Int32)

    Gets the value of the specified column as a Boolean.

    Declaration
    public override bool GetBoolean(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Boolean

    The value of the specified column.

    Overrides
    DbDataReader.GetBoolean(Int32)

    GetBoolean(String)

    Gets the value of the specified column as a Boolean.

    Declaration
    public bool GetBoolean(string name)
    Parameters
    Type Name Description
    String name

    The column name.

    Returns
    Type Description
    Boolean

    The value of the specified column.

    GetByte(Int32)

    Gets the value of the specified column as a byte.

    Declaration
    public override byte GetByte(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Byte

    The value of the specified column.

    Overrides
    DbDataReader.GetByte(Int32)

    GetByte(String)

    Gets the value of the specified column as a byte.

    Declaration
    public byte GetByte(string name)
    Parameters
    Type Name Description
    String name

    The column name.

    Returns
    Type Description
    Byte

    The value of the specified column.

    GetBytes(Int32, Int64, Byte[], Int32, Int32)

    Reads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset.

    Declaration
    public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Int64 fieldOffset

    The index within the field from which to begin the read operation.

    Byte[] buffer

    The buffer into which to read the stream of bytes.

    Int32 bufferoffset

    The index for buffer to begin the read operation.

    Int32 length

    The maximum length to copy into the buffer.

    Returns
    Type Description
    Int64

    The actual number of bytes read.

    Overrides
    DbDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32)

    GetChar(Int32)

    Gets the value of the specified column as a single character.

    Declaration
    public override char GetChar(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Char

    The value of the specified column.

    Overrides
    DbDataReader.GetChar(Int32)

    GetChar(String)

    Gets the value of the specified column as a single character.

    Declaration
    public char GetChar(string name)
    Parameters
    Type Name Description
    String name

    The column name.

    Returns
    Type Description
    Char

    The value of the specified column.

    GetChars(Int32, Int64, Char[], Int32, Int32)

    Reads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset.

    Declaration
    public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Int64 fieldoffset

    The index within the row from which to begin the read operation.

    Char[] buffer

    The buffer into which to copy the data.

    Int32 bufferoffset

    The index with the buffer to which the data will be copied.

    Int32 length

    The maximum number of characters to read.

    Returns
    Type Description
    Int64

    The actual number of characters read.

    Overrides
    DbDataReader.GetChars(Int32, Int64, Char[], Int32, Int32)

    GetDataTypeName(Int32)

    Gets the name of the source data type.

    Declaration
    public override string GetDataTypeName(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    String

    A string representing the name of the data type.

    Overrides
    DbDataReader.GetDataTypeName(Int32)

    GetDateTime(Int32)

    Gets the value of the specified column as a DateTime object.

    Declaration
    public override DateTime GetDateTime(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    DateTime

    The value of the specified column.

    Overrides
    DbDataReader.GetDateTime(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a DateTime object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    note

    MySql allows date columns to contain the value '0000-00-00' and datetime columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot contain or represent these values. To read a datetime value from a column that might contain zero values, use GetMySqlDateTime(Int32).

    The behavior of reading a zero datetime column using this method is defined by the ZeroDateTimeBehavior connection string option. For more information on this option, please refer to ConnectionString.

    GetDateTime(String)

    Gets the value of the specified column as a DateTime object.

    Declaration
    public DateTime GetDateTime(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    DateTime

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a DateTime object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    note

    MySql allows date columns to contain the value '0000-00-00' and datetime columns to contain the value '0000-00-00 00:00:00'. The DateTime structure cannot contain or represent these values. To read a datetime value from a column that might contain zero values, use GetMySqlDateTime(Int32).

    The behavior of reading a zero datetime column using this method is defined by the ZeroDateTimeBehavior connection string option. For more information on this option, please refer to ConnectionString.

    GetDecimal(Int32)

    Gets the value of the specified column as a Decimal object.

    Declaration
    public override decimal GetDecimal(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal

    Returns
    Type Description
    Decimal

    The value of the specified column.

    Overrides
    DbDataReader.GetDecimal(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Decimal object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetDecimal(String)

    Gets the value of the specified column as a Decimal object.

    Declaration
    public decimal GetDecimal(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Decimal

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Decimal object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetDouble(Int32)

    Gets the value of the specified column as a double-precision floating point number.

    Declaration
    public override double GetDouble(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Double

    The value of the specified column.

    Overrides
    DbDataReader.GetDouble(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Double object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetDouble(String)

    Gets the value of the specified column as a double-precision floating point number.

    Declaration
    public double GetDouble(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Double

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Double object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetEnumerator()

    Returns an IEnumerator that iterates through the MySqlDataReader.

    Declaration
    public override IEnumerator GetEnumerator()
    Returns
    Type Description
    IEnumerator

    An IEnumerator that can be used to iterate through the rows in the data reader.

    Overrides
    DbDataReader.GetEnumerator()

    GetFieldType(Int32)

    Gets the Type that is the data type of the object.

    Declaration
    public override Type GetFieldType(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Type

    The data type of the specified column.

    Overrides
    DbDataReader.GetFieldType(Int32)

    GetFieldType(String)

    Gets the Type that is the data type of the object.

    Declaration
    public Type GetFieldType(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Type

    The data type of the specified column.

    GetFieldValue<T>(Int32)

    Gets the value of the specified column as a type.

    Declaration
    public override T GetFieldValue<T>(int ordinal)
    Parameters
    Type Name Description
    Int32 ordinal

    The index of the column.

    Returns
    Type Description
    T

    The value of the column.

    Type Parameters
    Name Description
    T

    Type.

    Overrides
    DbDataReader.GetFieldValue<T>(Int32)

    GetFloat(Int32)

    Gets the value of the specified column as a single-precision floating point number.

    Declaration
    public override float GetFloat(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Single

    The value of the specified column.

    Overrides
    DbDataReader.GetFloat(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Single object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetFloat(String)

    Gets the value of the specified column as a single-precision floating point number.

    Declaration
    public float GetFloat(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Single

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Single object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetGuid(Int32)

    Gets the value of the specified column as a globally-unique identifier(GUID).

    Declaration
    public override Guid GetGuid(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Guid

    The value of the specified column.

    Overrides
    DbDataReader.GetGuid(Int32)

    GetGuid(String)

    Gets the value of the specified column as a globally-unique identifier(GUID).

    Declaration
    public Guid GetGuid(string column)
    Parameters
    Type Name Description
    String column

    The name of the column.

    Returns
    Type Description
    Guid

    The value of the specified column.

    GetInt16(Int32)

    Gets the value of the specified column as a 16-bit signed integer.

    Declaration
    public override short GetInt16(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Int16

    The value of the specified column.

    Overrides
    DbDataReader.GetInt16(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int16 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetInt16(String)

    Gets the value of the specified column as a 16-bit signed integer.

    Declaration
    public short GetInt16(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Int16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int16 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetInt32(Int32)

    Gets the value of the specified column as a 32-bit signed integer.

    Declaration
    public override int GetInt32(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Int32

    The value of the specified column.

    Overrides
    DbDataReader.GetInt32(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int32 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetInt32(String)

    Gets the value of the specified column as a 32-bit signed integer.

    Declaration
    public int GetInt32(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Int32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int32 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetInt64(Int32)

    Gets the value of the specified column as a 64-bit signed integer.

    Declaration
    public override long GetInt64(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Int64

    The value of the specified column.

    Overrides
    DbDataReader.GetInt64(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int64 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetInt64(String)

    Gets the value of the specified column as a 64-bit signed integer.

    Declaration
    public long GetInt64(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    Int64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a Int64 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetMySqlDateTime(Int32)

    Gets the value of the specified column as a MySqlDateTime object.

    Declaration
    public MySqlDateTime GetMySqlDateTime(int column)
    Parameters
    Type Name Description
    Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    MySqlDateTime

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a DateTime object.

    Call IsDBNull to check for null values before calling this method.

    GetMySqlDateTime(String)

    Gets the value of the specified column as a MySqlDateTime object.

    Declaration
    public MySqlDateTime GetMySqlDateTime(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    MySqlDateTime

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a DateTime object.

    Call IsDBNull to check for null values before calling this method.

    GetMySqlDecimal(Int32)

    Gets the value of the specified column as a MySqlDecimal.

    Declaration
    public MySqlDecimal GetMySqlDecimal(int i)
    Parameters
    Type Name Description
    Int32 i

    The index of the colum.

    Returns
    Type Description
    MySqlDecimal

    The value of the specified column as a MySqlDecimal.

    GetMySqlDecimal(String)

    Gets the value of the specified column as a MySqlDecimal.

    Declaration
    public MySqlDecimal GetMySqlDecimal(string column)
    Parameters
    Type Name Description
    String column

    The name of the colum.

    Returns
    Type Description
    MySqlDecimal

    The value of the specified column as a MySqlDecimal.

    GetMySqlGeometry(Int32)

    Gets the value of the specified column as a MySqlGeometry.

    Declaration
    public MySqlGeometry GetMySqlGeometry(int i)
    Parameters
    Type Name Description
    Int32 i

    The index of the colum.

    Returns
    Type Description
    MySqlGeometry

    The value of the specified column as a MySqlGeometry.

    GetMySqlGeometry(String)

    Gets the value of the specified column as a MySqlGeometry.

    Declaration
    public MySqlGeometry GetMySqlGeometry(string column)
    Parameters
    Type Name Description
    String column

    The name of the colum.

    Returns
    Type Description
    MySqlGeometry

    The value of the specified column as a MySqlGeometry.

    GetName(Int32)

    Gets the name of the specified column.

    Declaration
    public override string GetName(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    String

    The name of the specified column.

    Overrides
    DbDataReader.GetName(Int32)

    GetOrdinal(String)

    Gets the column ordinal, given the name of the column.

    Declaration
    public override int GetOrdinal(string name)
    Parameters
    Type Name Description
    String name

    The name of the column.

    Returns
    Type Description
    Int32

    The zero-based column ordinal.

    Overrides
    DbDataReader.GetOrdinal(String)

    GetSByte(Int32)

    Gets the value of the specified column as a sbyte.

    Declaration
    public sbyte GetSByte(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    SByte

    The value of the specified column.

    GetSByte(String)

    Gets the value of the specified column as a sbyte.

    Declaration
    public sbyte GetSByte(string name)
    Parameters
    Type Name Description
    String name

    The column name.

    Returns
    Type Description
    SByte

    The value of the specified column.

    GetSchemaTable()

    Returns a DataTable that describes the column metadata of the MySqlDataReader.

    Declaration
    public override DataTable GetSchemaTable()
    Returns
    Type Description
    DataTable
    Overrides
    DbDataReader.GetSchemaTable()

    GetStream(Int32)

    Gets a stream to retrieve data from the specified column.

    Declaration
    public override Stream GetStream(int i)
    Parameters
    Type Name Description
    Int32 i
    Returns
    Type Description
    Stream

    A stream

    Overrides
    DbDataReader.GetStream(Int32)

    GetString(Int32)

    Gets the value of the specified column as a String object.

    Declaration
    public override string GetString(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    String

    The value of the specified column.

    Overrides
    DbDataReader.GetString(Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a String object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetString(String)

    Gets the value of the specified column as a String object.

    Declaration
    public string GetString(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    String

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a String object.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetTimeSpan(Int32)

    Gets the value of the specified column as a TimeSpan object.

    Declaration
    public TimeSpan GetTimeSpan(int column)
    Parameters
    Type Name Description
    Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    TimeSpan

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a TimeSpan value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetTimeSpan(String)

    Gets the value of the specified column as a TimeSpan object.

    Declaration
    public TimeSpan GetTimeSpan(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    TimeSpan

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a TimeSpan value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt16(Int32)

    Gets the value of the specified column as a 16-bit unsigned integer.

    Declaration
    public ushort GetUInt16(int column)
    Parameters
    Type Name Description
    Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    UInt16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt16 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt16(String)

    Gets the value of the specified column as a 16-bit unsigned integer.

    Declaration
    public ushort GetUInt16(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    UInt16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt16 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt32(Int32)

    Gets the value of the specified column as a 32-bit unsigned integer.

    Declaration
    public uint GetUInt32(int column)
    Parameters
    Type Name Description
    Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    UInt32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt32 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt32(String)

    Gets the value of the specified column as a 32-bit unsigned integer.

    Declaration
    public uint GetUInt32(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    UInt32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt32 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt64(Int32)

    Gets the value of the specified column as a 64-bit unsigned integer.

    Declaration
    public ulong GetUInt64(int column)
    Parameters
    Type Name Description
    Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    UInt64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt64 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetUInt64(String)

    Gets the value of the specified column as a 64-bit unsigned integer.

    Declaration
    public ulong GetUInt64(string column)
    Parameters
    Type Name Description
    String column

    The column name.

    Returns
    Type Description
    UInt64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a UInt64 value.

    Call IsDBNull(Int32) to check for null values before calling this method.

    GetValue(Int32)

    Gets the value of the specified column in its native format.

    Declaration
    public override object GetValue(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Object

    The value of the specified column.

    Overrides
    DbDataReader.GetValue(Int32)

    GetValues(Object[])

    Gets all attribute columns in the collection for the current row.

    Declaration
    public override int GetValues(object[] values)
    Parameters
    Type Name Description
    Object[] values

    An array of Object into which to copy the attribute columns.

    Returns
    Type Description
    Int32

    The number of instances of Object in the array.

    Overrides
    DbDataReader.GetValues(Object[])

    IsDBNull(Int32)

    Gets a value indicating whether the column contains non-existent or missing values.

    Declaration
    public override bool IsDBNull(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    Boolean

    true if the specified column is equivalent to DBNull; otherwise false.

    Overrides
    DbDataReader.IsDBNull(Int32)

    NextResult()

    Advances the data reader to the next result, when reading the results of batch SQL statements.

    Declaration
    public override bool NextResult()
    Returns
    Type Description
    Boolean

    true if there are more result sets; otherwise false.

    Overrides
    DbDataReader.NextResult()

    Read()

    Advances the MySqlDataReader to the next record.

    Declaration
    public override bool Read()
    Returns
    Type Description
    Boolean

    true if there are more rows; otherwise false.

    Overrides
    DbDataReader.Read()

    Explicit Interface Implementations

    IDataRecord.GetData(Int32)

    Returns a DbDataReader object for the requested column ordinal.

    Declaration
    IDataReader IDataRecord.GetData(int i)
    Parameters
    Type Name Description
    Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    IDataReader

    A DbDataReader object.

    Implements

    System.Collections.IEnumerable
    System.IAsyncDisposable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    In This Article
    Back to top Copyright © 2021, 2023, Oracle and/or its affiliates.