1. Object TypeDataReader

    Article: AN0001754Updated:

    This object encapsulate .NET object DataReader and provides type functions for each data type. This saves time with value conversion.

    Object properties

     

    Name Description
    bool Read() Function performs reading of one record from the database. If True is returned, record was read. Otherwise, there is no other record.
    void Close() Method closes reader.
    void Dispose() Method releases reader resources.
    bool IsDBNull( object value) Function finds out if the passed value is NULL or DBNull type.
    string GetString(string columnName) Function returns text.
    string GetString(string columnName, string defaultValue) Function returns text.
    int GetInteger(string columnName) Function returns integer.
    int GetInteger(string columnName, int defaultValue) Function returns integer.
    int? GetNullInteger(string columnName) Function returns integer.
    double GetDouble(string columnName) Function returns decimal.
    double GetDouble(string columnName, double defaultValue) Function returns decimal.
    double? GetNullDouble(string columnName) Function returns decimal.
    decimal GetDecimal(string columnName) Function returns decimal.
    decimal GetDecimal(string columnName, decimal defaultValue) Function returns decimal.
    decimal? GetNullDecimal(string columnName) Function returns decimal.
    DateTime GetDateTime(string columnName) Function returns date.
    DateTime GetDateTime(string columnName, DateTime defaultValue) Function returns date.
    DateTime? GetNullDateTime(string columnName) Function returns date.
    TimeSpan? GetNullTimeSpan(string columnName) Function returns time.
    bool GetBoolean(string columnName) Function returns Yes/No indication.
    bool GetBoolean(string columnName, bool defaultValue) Function returns Yes/No indication.
    bool? GetNullBoolean(string columnName) Function returns Yes/No indication.
    object GetObject(string columnName) Function returns object.
    Guid GetGuid(string columnName) Function returns guid.

     

×