Show / Hide Table of Contents

    Class CsvDataReader

    Provides a way of reading a forward-only stream of rows from a CSV based data source. This class cannot be inherited.

    Inheritance
    System.Object
    System.Data.Common.DbDataReader
    StringDataReader
    CsvDataReader
    Implements
    System.Collections.IEnumerable
    System.Data.IDataReader
    System.Data.IDataRecord
    System.IDisposable
    Inherited Members
    StringDataReader.Contains(String)
    StringDataReader.Item[String]
    StringDataReader.Item[Int32]
    StringDataReader.RecordsAffected
    StringDataReader.IsClosed
    StringDataReader.IsDisposed
    StringDataReader.StringParser
    StringDataReader.RowCount
    StringDataReader.FieldCount
    StringDataReader.ToString()
    StringDataReader.Read()
    StringDataReader.SetFields(IOrderedDictionary)
    StringDataReader.GetBoolean(Int32)
    StringDataReader.GetByte(Int32)
    StringDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32)
    StringDataReader.GetChar(Int32)
    StringDataReader.GetDateTime(Int32)
    StringDataReader.GetDecimal(Int32)
    StringDataReader.GetDouble(Int32)
    StringDataReader.GetFieldType(Int32)
    StringDataReader.GetFloat(Int32)
    StringDataReader.GetGuid(Int32)
    StringDataReader.GetInt16(Int32)
    StringDataReader.GetInt32(Int32)
    StringDataReader.GetInt64(Int32)
    StringDataReader.GetName(Int32)
    StringDataReader.GetOrdinal(String)
    StringDataReader.GetString(Int32)
    StringDataReader.GetValue(Int32)
    StringDataReader.IsDBNull(Int32)
    StringDataReader.Depth
    StringDataReader.GetValues(Object[])
    StringDataReader.NextResult()
    StringDataReader.GetChars(Int32, Int64, Char[], Int32, Int32)
    StringDataReader.GetDataTypeName(Int32)
    StringDataReader.GetEnumerator()
    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.VisibleFieldCount
    Namespace: Cuemon.Data.CsvClient
    Assembly: Cuemon.Data.dll
    Syntax
    public sealed class CsvDataReader : StringDataReader, IEnumerable, IDataReader, IDataRecord, IDisposable

    Constructors

    | Improve this Doc

    CsvDataReader(StreamReader, String)

    Initializes a new instance of the CsvDataReader class.

    Declaration
    public CsvDataReader(StreamReader reader, string header)
    Parameters
    Type Name Description
    System.IO.StreamReader reader

    The System.IO.StreamReader object that contains the CSV data.

    System.String header

    The header defining the columns of the CSV data.

    Exceptions
    Type Condition
    System.ArgumentException

    header does not contain comma (",") as delimiter.

    System.ArgumentNullException

    reader is null -or- header is null.

    ArgumentEmptyException

    header is empty.

    | Improve this Doc

    CsvDataReader(StreamReader, String, String)

    Initializes a new instance of the CsvDataReader class.

    Declaration
    public CsvDataReader(StreamReader reader, string header, string delimiter)
    Parameters
    Type Name Description
    System.IO.StreamReader reader

    The System.IO.StreamReader object that contains the CSV data.

    System.String header

    The header defining the columns of the CSV data.

    System.String delimiter

    The delimiter specification.

    Remarks

    The default implementation uses comma (",") as delimiter.

    Exceptions
    Type Condition
    System.ArgumentException

    header does not contain the specified delimiter.

    System.ArgumentNullException

    reader is null -or- header is null -or- delimiter is null.

    ArgumentEmptyException

    header is empty -or- delimiter is empty.

    | Improve this Doc

    CsvDataReader(StreamReader, String, String, Func<String, Object>)

    Initializes a new instance of the CsvDataReader class.

    Declaration
    public CsvDataReader(StreamReader reader, string header, string delimiter, Func<string, object> parser)
    Parameters
    Type Name Description
    System.IO.StreamReader reader

    The System.IO.StreamReader object that contains the CSV data.

    System.String header

    The header defining the columns of the CSV data.

    System.String delimiter

    The delimiter specification.

    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.

    Exceptions
    Type Condition
    System.ArgumentException

    header does not contain the specified delimiter.

    System.ArgumentNullException

    reader is null -or- header is null -or- delimiter is null -or- parser is null.

    ArgumentEmptyException

    header is empty -or- delimiter is empty.

    Properties

    | Improve this Doc

    Delimiter

    Gets the delimiter used to separate fields of this instance.

    Declaration
    public string Delimiter { get; }
    Property Value
    Type Description
    System.String

    The delimiter used to separate fields of this instance.

    | Improve this Doc

    HasRows

    Gets a value that indicates whether this System.Data.Common.DbDataReader contains one or more rows.

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

    true if this instance has rows; otherwise, false.

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

    Header

    Gets the header that defines the field names of this instance.

    Declaration
    public string[] Header { get; }
    Property Value
    Type Description
    System.String[]

    The header that defines the field names of this instance.

    Methods

    | 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
    StringDataReader.Dispose(Boolean)
    | Improve this Doc

    ReadNext()

    Advances this instance to the next line of the CSV data source.

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

    true if there are more lines; otherwise, false.

    Overrides
    StringDataReader.ReadNext()

    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