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
    System.Object
    System.MarshalByRefObject
    System.Data.Common.DbDataReader
    MySqlDataReader
    Implements
    System.Collections.IEnumerable
    System.IAsyncDisposable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    Namespace: MySql.Data.MySqlClient
    Assembly: MySql.Data.dll
    Version: 9.3.0
    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
    System.Int32

    The depth of nesting for the current row.

    Overrides
    System.Data.Common.DbDataReader.Depth

    FieldCount

    Gets the number of columns in the current row.

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

    The number of columns in the current row.

    Overrides
    System.Data.Common.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
    System.Boolean

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

    Overrides
    System.Data.Common.DbDataReader.HasRows

    IsClosed

    Gets a value indicating whether the data reader is closed.

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

    true if the MySqlDataReader is closed; otherwise false.

    Overrides
    System.Data.Common.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
    System.Int32 i
    Property Value
    Type Description
    System.Object

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.Item[System.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
    System.String name
    Property Value
    Type Description
    System.Object

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.Item[System.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
    System.Int32

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

    Overrides
    System.Data.Common.DbDataReader.RecordsAffected

    Methods

    Close()

    Closes the MySqlDataReader object.

    Declaration
    public override void Close()
    Overrides
    System.Data.Common.DbDataReader.Close()

    CloseAsync()

    Asynchronously closes the MySqlDataReader object.

    Declaration
    public override Task CloseAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A task representing the asynchronous operation.

    Overrides
    System.Data.Common.DbDataReader.CloseAsync()

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    System.Data.Common.DbDataReader.Dispose(System.Boolean)

    DisposeAsync()

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

    Declaration
    public override ValueTask DisposeAsync()
    Returns
    Type Description
    System.Threading.Tasks.ValueTask
    Overrides
    System.Data.Common.DbDataReader.DisposeAsync()

    Finalize()

    Declaration
    protected void Finalize()

    GetBodyDefinition(String)

    Gets the body definition of a routine.

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

    The column name.

    Returns
    Type Description
    System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Boolean

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetBoolean(System.Int32)

    GetBoolean(String)

    Gets the value of the specified column as a Boolean.

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

    The column name.

    Returns
    Type Description
    System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Byte

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetByte(System.Int32)

    GetByte(String)

    Gets the value of the specified column as a byte.

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

    The column name.

    Returns
    Type Description
    System.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
    System.Int32 i

    The zero-based column ordinal.

    System.Int64 fieldOffset

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

    System.Byte[] buffer

    The buffer into which to read the stream of bytes.

    System.Int32 bufferoffset

    The index for buffer to begin the read operation.

    System.Int32 length

    The maximum length to copy into the buffer.

    Returns
    Type Description
    System.Int64

    The actual number of bytes read.

    Overrides
    System.Data.Common.DbDataReader.GetBytes(System.Int32, System.Int64, System.Byte[], System.Int32, System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Char

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetChar(System.Int32)

    GetChar(String)

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

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

    The column name.

    Returns
    Type Description
    System.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
    System.Int32 i

    The zero-based column ordinal.

    System.Int64 fieldoffset

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

    System.Char[] buffer

    The buffer into which to copy the data.

    System.Int32 bufferoffset

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

    System.Int32 length

    The maximum number of characters to read.

    Returns
    Type Description
    System.Int64

    The actual number of characters read.

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

    GetDataTypeName(Int32)

    Gets the name of the source data type.

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.String

    A string representing the name of the data type.

    Overrides
    System.Data.Common.DbDataReader.GetDataTypeName(System.Int32)

    GetDateTime(Int32)

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

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.DateTime

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetDateTime(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.DateTime object.

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

    The column name.

    Returns
    Type Description
    System.DateTime

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.Decimal object.

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

    The zero-based column ordinal

    Returns
    Type Description
    System.Decimal

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetDecimal(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.Decimal object.

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

    The column name.

    Returns
    Type Description
    System.Decimal

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Double

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetDouble(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.Double

    The value of the specified column.

    Remarks

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

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

    GetEnumerator()

    Returns an System.Collections.IEnumerator that iterates through the MySqlDataReader.

    Declaration
    public override IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

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

    Overrides
    System.Data.Common.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Type

    The data type of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetFieldType(System.Int32)

    GetFieldType(String)

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

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

    The column name.

    Returns
    Type Description
    System.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
    System.Int32 ordinal

    The index of the column.

    Returns
    Type Description
    T

    The value of the column.

    Type Parameters
    Name Description
    T

    Type.

    Overrides
    System.Data.Common.DbDataReader.GetFieldValue<T>(System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Single

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetFloat(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.Single

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Guid

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetGuid(System.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
    System.String column

    The name of the column.

    Returns
    Type Description
    System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Int16

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetInt16(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.Int16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Int32

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetInt32(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.Int32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Int64

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetInt64(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.Int64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.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 System.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
    System.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 System.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
    System.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
    System.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
    System.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
    System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.String

    The name of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetName(System.Int32)

    GetOrdinal(String)

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

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

    The name of the column.

    Returns
    Type Description
    System.Int32

    The zero-based column ordinal.

    Overrides
    System.Data.Common.DbDataReader.GetOrdinal(System.String)

    GetSByte(Int32)

    Gets the value of the specified column as a sbyte.

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.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
    System.String name

    The column name.

    Returns
    Type Description
    System.SByte

    The value of the specified column.

    GetSchemaTable()

    Describes the column metadata of the MySqlDataReader.

    Declaration
    public override DataTable GetSchemaTable()
    Returns
    Type Description
    System.Data.DataTable

    A System.Data.DataTable object.

    Overrides
    System.Data.Common.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.IO.Stream

    A stream

    Overrides
    System.Data.Common.DbDataReader.GetStream(System.Int32)

    GetString(Int32)

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

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.String

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetString(System.Int32)
    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.String object.

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

    The column name.

    Returns
    Type Description
    System.String

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.TimeSpan object.

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.TimeSpan

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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 System.TimeSpan object.

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

    The column name.

    Returns
    Type Description
    System.TimeSpan

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    System.UInt16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.UInt16

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    System.UInt32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.UInt32

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 column

    The zero-based column ordinal.

    Returns
    Type Description
    System.UInt64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.String column

    The column name.

    Returns
    Type Description
    System.UInt64

    The value of the specified column.

    Remarks

    No conversions are performed; therefore, the data retrieved must already be a System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Object

    The value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetValue(System.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
    System.Object[] values

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

    Returns
    Type Description
    System.Int32

    The number of instances of System.Object in the array.

    Overrides
    System.Data.Common.DbDataReader.GetValues(System.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
    System.Int32 i

    The zero-based column ordinal.

    Returns
    Type Description
    System.Boolean

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

    Overrides
    System.Data.Common.DbDataReader.IsDBNull(System.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
    System.Boolean

    true if there are more result sets; otherwise false.

    Overrides
    System.Data.Common.DbDataReader.NextResult()

    NextResultAsync(CancellationToken)

    Declaration
    public override Task<bool> NextResultAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>
    Overrides
    System.Data.Common.DbDataReader.NextResultAsync(System.Threading.CancellationToken)

    Read()

    Advances the MySqlDataReader to the next record.

    Declaration
    public override bool Read()
    Returns
    Type Description
    System.Boolean

    true if there are more rows; otherwise false.

    Overrides
    System.Data.Common.DbDataReader.Read()

    ReadAsync(CancellationToken)

    Declaration
    public override Task<bool> ReadAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Boolean>
    Overrides
    System.Data.Common.DbDataReader.ReadAsync(System.Threading.CancellationToken)

    Explicit Interface Implementations

    IDataRecord.GetData(Int32)

    Returns a System.Data.Common.DbDataReader object for the requested column ordinal.

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

    The zero-based column ordinal.

    Returns
    Type Description
    System.Data.IDataReader

    A System.Data.Common.DbDataReader object.

    Implements

    System.Collections.IEnumerable
    System.IAsyncDisposable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    In This Article
    • Properties
      • Depth
      • FieldCount
      • HasRows
      • IsClosed
      • Item[Int32]
      • Item[String]
      • RecordsAffected
    • Methods
      • Close()
      • CloseAsync()
      • Dispose(Boolean)
      • DisposeAsync()
      • Finalize()
      • GetBodyDefinition(String)
      • GetBoolean(Int32)
      • GetBoolean(String)
      • GetByte(Int32)
      • GetByte(String)
      • GetBytes(Int32, Int64, Byte[], Int32, Int32)
      • GetChar(Int32)
      • GetChar(String)
      • GetChars(Int32, Int64, Char[], Int32, Int32)
      • GetDataTypeName(Int32)
      • GetDateTime(Int32)
      • GetDateTime(String)
      • GetDecimal(Int32)
      • GetDecimal(String)
      • GetDouble(Int32)
      • GetDouble(String)
      • GetEnumerator()
      • GetFieldType(Int32)
      • GetFieldType(String)
      • GetFieldValue<T>(Int32)
      • GetFloat(Int32)
      • GetFloat(String)
      • GetGuid(Int32)
      • GetGuid(String)
      • GetInt16(Int32)
      • GetInt16(String)
      • GetInt32(Int32)
      • GetInt32(String)
      • GetInt64(Int32)
      • GetInt64(String)
      • GetMySqlDateTime(Int32)
      • GetMySqlDateTime(String)
      • GetMySqlDecimal(Int32)
      • GetMySqlDecimal(String)
      • GetMySqlGeometry(Int32)
      • GetMySqlGeometry(String)
      • GetName(Int32)
      • GetOrdinal(String)
      • GetSByte(Int32)
      • GetSByte(String)
      • GetSchemaTable()
      • GetStream(Int32)
      • GetString(Int32)
      • GetString(String)
      • GetTimeSpan(Int32)
      • GetTimeSpan(String)
      • GetUInt16(Int32)
      • GetUInt16(String)
      • GetUInt32(Int32)
      • GetUInt32(String)
      • GetUInt64(Int32)
      • GetUInt64(String)
      • GetValue(Int32)
      • GetValues(Object[])
      • IsDBNull(Int32)
      • NextResult()
      • NextResultAsync(CancellationToken)
      • Read()
      • ReadAsync(CancellationToken)
    • Explicit Interface Implementations
      • IDataRecord.GetData(Int32)
    • Implements
    Back to top Copyright © 2021, 2025, Oracle and/or its affiliates.