Show / Hide Table of Contents

    Class StringDataReader

    Provides a generic way of reading a forward-only stream of rows from a System.String based data source. This is an abstract class.

    Inheritance
    System.Object
    System.Data.Common.DbDataReader
    StringDataReader
    CsvDataReader
    XmlDataReader
    Implements
    System.Collections.IEnumerable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    Inherited Members
    System.Data.Common.DbDataReader.Dispose()
    System.Data.Common.DbDataReader.GetData(System.Int32)
    System.Data.Common.DbDataReader.GetDbDataReader(System.Int32)
    System.Data.Common.DbDataReader.GetFieldValue<T>(System.Int32)
    System.Data.Common.DbDataReader.GetFieldValueAsync<T>(System.Int32)
    System.Data.Common.DbDataReader.GetFieldValueAsync<T>(System.Int32, System.Threading.CancellationToken)
    System.Data.Common.DbDataReader.GetProviderSpecificFieldType(System.Int32)
    System.Data.Common.DbDataReader.GetProviderSpecificValue(System.Int32)
    System.Data.Common.DbDataReader.GetProviderSpecificValues(System.Object[])
    System.Data.Common.DbDataReader.GetStream(System.Int32)
    System.Data.Common.DbDataReader.GetTextReader(System.Int32)
    System.Data.Common.DbDataReader.IsDBNullAsync(System.Int32)
    System.Data.Common.DbDataReader.IsDBNullAsync(System.Int32, System.Threading.CancellationToken)
    System.Data.Common.DbDataReader.NextResultAsync()
    System.Data.Common.DbDataReader.NextResultAsync(System.Threading.CancellationToken)
    System.Data.Common.DbDataReader.ReadAsync()
    System.Data.Common.DbDataReader.ReadAsync(System.Threading.CancellationToken)
    System.Data.Common.DbDataReader.System.Data.IDataRecord.GetData(System.Int32)
    System.Data.Common.DbDataReader.System.Data.IDataReader.Close()
    System.Data.Common.DbDataReader.System.Data.IDataReader.GetSchemaTable()
    System.Data.Common.DbDataReader.HasRows
    System.Data.Common.DbDataReader.VisibleFieldCount
    Namespace: Cuemon.Data
    Assembly: Cuemon.Data.dll
    Syntax
    public abstract class StringDataReader : DbDataReader, IEnumerable, IDataReader, IDataRecord, IDisposable

    Constructors

    | Improve this Doc

    StringDataReader()

    Initializes a new instance of the StringDataReader class.

    Declaration
    protected StringDataReader()
    | Improve this Doc

    StringDataReader(Func<String, Object>)

    Initializes a new instance of the StringDataReader class.

    Declaration
    protected StringDataReader(Func<string, object> parser)
    Parameters
    Type Name Description
    System.Func<System.String, System.Object> parser

    The function delegate that returns a primitive object whose value is equivalent to the provided System.String value.

    Remarks

    The default implementation uses FromString(String) as parser.

    Properties

    | Improve this Doc

    Depth

    Gets a value indicating the depth of nesting for the current row.

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

    The level of nesting.

    Overrides
    System.Data.Common.DbDataReader.Depth
    | Improve this Doc

    FieldCount

    Gets the number of columns in the current row.

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

    When not positioned in a valid recordset, 0; otherwise, the number of columns in the current record.

    Overrides
    System.Data.Common.DbDataReader.FieldCount
    | Improve this Doc

    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 this instance is closed; otherwise, false.

    Overrides
    System.Data.Common.DbDataReader.IsClosed
    | Improve this Doc

    IsDisposed

    Gets a value indicating whether this instance is disposed.

    Declaration
    protected bool IsDisposed { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is disposed; otherwise, false.

    | Improve this Doc

    Item[Int32]

    Gets the column located at the specified index.

    Declaration
    public override object this[int i] { get; }
    Parameters
    Type Name Description
    System.Int32 i

    The zero-based index of the column to get.

    Property Value
    Type Description
    System.Object

    The column located at the specified index as an System.Object.

    Overrides
    System.Data.Common.DbDataReader.Item[System.Int32]
    | Improve this Doc

    Item[String]

    Gets the column with the specified name.

    Declaration
    public override object this[string name] { get; }
    Parameters
    Type Name Description
    System.String name

    The name of the column to find.

    Property Value
    Type Description
    System.Object

    The column with the specified name as an System.Object.

    Overrides
    System.Data.Common.DbDataReader.Item[System.String]
    | Improve this Doc

    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 records affected.

    Overrides
    System.Data.Common.DbDataReader.RecordsAffected
    | Improve this Doc

    RowCount

    Gets the currently processed row count of this instance.

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

    The currently processed row count of this instance.

    Remarks

    This property is incremented when the invoked Read() method returns true.

    | Improve this Doc

    StringParser

    Gets a reference to the function delegate that returns a primitive object whose value is equivalent to the provided System.String value.

    Declaration
    protected Func<string, object> StringParser { get; }
    Property Value
    Type Description
    System.Func<System.String, System.Object>

    A reference to the function delegate that this instance was constructed with.

    Methods

    | Improve this Doc

    Contains(String)

    Determines whether this instance contains a column with the specified name.

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

    The name of the column to find.

    Returns
    Type Description
    System.Boolean

    true if this instance contains a column with the specified name; otherwise, false.

    | Improve this Doc

    Dispose(Boolean)

    Releases unmanaged and - optionally - managed resources.

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

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Overrides
    System.Data.Common.DbDataReader.Dispose(System.Boolean)
    | Improve this Doc

    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 column.

    Overrides
    System.Data.Common.DbDataReader.GetBoolean(System.Int32)
    | Improve this Doc

    GetByte(Int32)

    Gets the 8-bit unsigned integer value of the specified column.

    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 8-bit unsigned integer value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetByte(System.Int32)
    | Improve this Doc

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

    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.

    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 row from which to begin the read operation.

    System.Byte[] 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 bytes read.

    Overrides
    System.Data.Common.DbDataReader.GetBytes(System.Int32, System.Int64, System.Byte[], System.Int32, System.Int32)
    | Improve this Doc

    GetChar(Int32)

    Gets the character value of the specified column.

    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 character value of the specified column.

    Overrides
    System.Data.Common.DbDataReader.GetChar(System.Int32)
    | Improve this Doc

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

    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.

    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)
    | Improve this Doc

    GetDataTypeName(Int32)

    Gets the name of the 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

    System.String.

    Overrides
    System.Data.Common.DbDataReader.GetDataTypeName(System.Int32)
    | Improve this Doc

    GetDateTime(Int32)

    Gets the date and time data value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.DateTime

    The date and time data value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetDateTime(System.Int32)
    | Improve this Doc

    GetDecimal(Int32)

    Gets the fixed-position numeric value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Decimal

    The fixed-position numeric value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetDecimal(System.Int32)
    | Improve this Doc

    GetDouble(Int32)

    Gets the double-precision floating point number of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Double

    The double-precision floating point number of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetDouble(System.Int32)
    | Improve this Doc

    GetEnumerator()

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

    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()
    Exceptions
    Type Condition
    System.NotImplementedException
    | Improve this Doc

    GetFieldType(Int32)

    Gets the System.Type information corresponding to the type of System.Object that would be returned from System.Data.IDataRecord.GetValue(Int32).

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

    The index of the field to find.

    Returns
    Type Description
    System.Type

    The System.Type information corresponding to the type of System.Object that would be returned from System.Data.IDataRecord.GetValue(Int32).

    Overrides
    System.Data.Common.DbDataReader.GetFieldType(System.Int32)
    | Improve this Doc

    GetFloat(Int32)

    Gets the single-precision floating point number of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Single

    The single-precision floating point number of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetFloat(System.Int32)
    | Improve this Doc

    GetGuid(Int32)

    Returns the GUID value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Guid

    The GUID value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetGuid(System.Int32)
    | Improve this Doc

    GetInt16(Int32)

    Gets the 16-bit signed integer value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Int16

    The 16-bit signed integer value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetInt16(System.Int32)
    | Improve this Doc

    GetInt32(Int32)

    Gets the 32-bit signed integer value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Int32

    The 32-bit signed integer value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetInt32(System.Int32)
    | Improve this Doc

    GetInt64(Int32)

    Gets the 64-bit signed integer value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Int64

    The 64-bit signed integer value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetInt64(System.Int32)
    | Improve this Doc

    GetName(Int32)

    Gets the name for the field to find.

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

    The index of the field to find.

    Returns
    Type Description
    System.String

    The name of the field or the empty string (""), if there is no value to return.

    Overrides
    System.Data.Common.DbDataReader.GetName(System.Int32)
    | Improve this Doc

    GetOrdinal(String)

    Return the index of the named field.

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

    The name of the field to find.

    Returns
    Type Description
    System.Int32

    The index of the named field.

    Overrides
    System.Data.Common.DbDataReader.GetOrdinal(System.String)
    Exceptions
    Type Condition
    System.ArgumentNullException

    name is null.

    System.ArgumentOutOfRangeException

    name is not a valid column name.

    | Improve this Doc

    GetString(Int32)

    Gets the string value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.String

    The string value of the specified field.

    Overrides
    System.Data.Common.DbDataReader.GetString(System.Int32)
    | Improve this Doc

    GetValue(Int32)

    Return the value of the specified field.

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

    The index of the field to find.

    Returns
    Type Description
    System.Object

    The System.Object which will contain the field value upon return.

    Overrides
    System.Data.Common.DbDataReader.GetValue(System.Int32)
    | Improve this Doc

    GetValues(Object[])

    Populates an array of objects with the column values of the current record.

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

    An array of System.Object to copy the attribute fields into.

    Returns
    Type Description
    System.Int32

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

    Overrides
    System.Data.Common.DbDataReader.GetValues(System.Object[])
    | Improve this Doc

    IsDBNull(Int32)

    Return whether the specified field is set to null.

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

    The index of the field to find.

    Returns
    Type Description
    System.Boolean

    true if the specified field is set to null; otherwise, false.

    Overrides
    System.Data.Common.DbDataReader.IsDBNull(System.Int32)
    | Improve this Doc

    NextResult()

    Advances the reader to the next result when reading the results of a batch of 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()
    | Improve this Doc

    Read()

    Advances the System.Data.DbDataReader 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()
    | Improve this Doc

    ReadNext()

    Advances the System.Data.DbDataReader to the next record.

    Declaration
    protected abstract bool ReadNext()
    Returns
    Type Description
    System.Boolean

    true if there are more rows; otherwise, false.

    | Improve this Doc

    SetFields(IOrderedDictionary)

    Sets the fields of the current record invoked by ReadNext().

    Declaration
    protected void SetFields(IOrderedDictionary fields)
    Parameters
    Type Name Description
    System.Collections.Specialized.IOrderedDictionary fields

    The fields of the current record invoked by ReadNext().

    | Improve this Doc

    ToString()

    Returns a System.String that represents the current row of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A System.String that represents the current row of this instance.

    Overrides
    System.Object.ToString()

    Implements

    System.Collections.IEnumerable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable

    Extension Methods

    DataTransferExtensions.ToRows(IDataReader)
    DataTransferExtensions.ToColumns(IDataReader)
    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX