Class CsvReader
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Inheritance
System.Object
CsvReader
Implements
System.Data.IDataReader
System.Data.IDataRecord
System.IDisposable
System.Collections.Generic.IEnumerable<System.String[]>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Mars.IO.dll
Syntax
public sealed class CsvReader : IDataReader, IDataRecord, IDisposable, IEnumerable<string[]>, IEnumerable
Constructors
|
Improve this Doc
View Source
CsvReader(Stream, Boolean)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(Stream stream, bool hasHeaders)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
A Stream pointing to the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
|
Improve this Doc
View Source
CsvReader(TextReader, Boolean, Char, Int32)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(TextReader reader, bool hasHeaders, char delimiter, int bufferSize)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
reader |
A TextReader pointing to the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
System.Char |
delimiter |
The delimiter character separating each field. If set to zero, the
delimiter will be detected from the file automatically. Default is '\0' (zero).
|
System.Int32 |
bufferSize |
The buffer size in bytes. |
|
Improve this Doc
View Source
CsvReader(TextReader, Boolean, Char)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(TextReader reader, bool hasHeaders, char delimiter)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
reader |
A TextReader pointing to the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
System.Char |
delimiter |
The delimiter character separating each field. If set to zero, the
delimiter will be detected from the file automatically. Default is '\0' (zero).
|
|
Improve this Doc
View Source
CsvReader(TextReader, Boolean, Int32)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(TextReader reader, bool hasHeaders, int bufferSize)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
reader |
A TextReader pointing to the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
System.Int32 |
bufferSize |
The buffer size in bytes. |
|
Improve this Doc
View Source
CsvReader(TextReader, Boolean)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(TextReader reader, bool hasHeaders)
Parameters
Type |
Name |
Description |
System.IO.TextReader |
reader |
A TextReader pointing to the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
|
Improve this Doc
View Source
CsvReader(String, Boolean)
Initializes a new instance of the CsvReader class.
Declaration
public CsvReader(string path, bool hasHeaders)
Parameters
Type |
Name |
Description |
System.String |
path |
The path for the CSV file. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
Fields
|
Improve this Doc
View Source
DefaultBufferSize
Defines the default buffer size.
Declaration
public const int DefaultBufferSize = 4096
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Defines the default comment character indicating that a line is commented out.
Declaration
public const char DefaultComment = '#'
Field Value
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
DefaultCsvDelimiters
The set of preconfigured default delimiter widely used as CSV delimiter characters.
Declaration
public static readonly char[] DefaultCsvDelimiters
Field Value
Type |
Description |
System.Char[] |
|
|
Improve this Doc
View Source
DefaultDelimiter
Defines the default delimiter character separating each field.
Declaration
public const char DefaultDelimiter = ','
Field Value
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
DefaultEscape
Defines the default escape character letting insert quotation characters inside a quoted field.
Declaration
public const char DefaultEscape = '"'
Field Value
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
DefaultQuote
Defines the default quote character wrapping every field.
Declaration
public const char DefaultQuote = '"'
Field Value
Type |
Description |
System.Char |
|
Properties
|
Improve this Doc
View Source
BufferSize
Gets the buffer size.
Declaration
public int BufferSize { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Gets the comment character indicating that
a line is commented out. Default is '#'.
Declaration
public char Comment { get; set; }
Property Value
Type |
Description |
System.Char |
The comment character indicating that a line is commented out. |
|
Improve this Doc
View Source
CurrentRecordIndex
Gets the current record index in the CSV file.
Declaration
public long CurrentRecordIndex { get; }
Property Value
Type |
Description |
System.Int64 |
The current record index in the CSV file. |
|
Improve this Doc
View Source
Gets or sets the default header name when it is an empty string or only whitespaces.
The header index will be appended to the specified name. Default is "Column".
Declaration
public string DefaultHeaderName { get; set; }
Property Value
Type |
Description |
System.String |
The default header name when it is an empty string or only whitespaces. |
|
Improve this Doc
View Source
DefaultParseErrorAction
Gets or sets the default action to take when a parsing error has occured.
Declaration
public ParseErrorAction DefaultParseErrorAction { get; set; }
Property Value
Type |
Description |
ParseErrorAction |
The default action to take when a parsing error has occured. |
|
Improve this Doc
View Source
Delimiter
Gets the delimiter character separating each field. If
set to zero ('\0') the reader will try to guess the
delimiter character automatically from the first line
of the file.
Declaration
public char Delimiter { get; set; }
Property Value
Type |
Description |
System.Char |
The delimiter character separating each field. |
|
Improve this Doc
View Source
EndOfStream
Gets a value that indicates whether the current stream position is at the end of the stream.
Declaration
public bool EndOfStream { get; }
Property Value
Type |
Description |
System.Boolean |
true if the current stream position is at the end of the stream; otherwise
false.
|
|
Improve this Doc
View Source
Escape
Gets the escape character letting insert quotation
characters inside a quoted field. Default is '"'.
Declaration
public char Escape { get; set; }
Property Value
Type |
Description |
System.Char |
The escape character letting insert quotation characters inside a quoted field. |
|
Improve this Doc
View Source
FieldCount
Gets the maximum number of fields to retrieve for each record.
Declaration
public int FieldCount { get; }
Property Value
Type |
Description |
System.Int32 |
The maximum number of fields to retrieve for each record. |
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
Indicates if field names are located on the first non commented line.
Declaration
public bool HasHeaders { get; }
Property Value
Type |
Description |
System.Boolean |
true if field names are located on the first non commented line, otherwise,
false.
|
|
Improve this Doc
View Source
IsDisposed
Gets a value indicating whether the instance has been disposed of.
Declaration
[Browsable(false)]
public bool IsDisposed { get; }
Property Value
Type |
Description |
System.Boolean |
true if the instance has been disposed of; otherwise, false.
|
|
Improve this Doc
View Source
Item[Int32, Int32]
Gets the field at the specified index and record position.
Declaration
public string this[int record, int field] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
record |
|
System.Int32 |
field |
|
Property Value
Type |
Description |
System.String |
The field at the specified index and record position.
A null is returned if the field cannot be found for the record.
|
Exceptions
Type |
Condition |
ArgumentOutOfRangeException |
field must be included in [0, FieldCount[.
|
ArgumentOutOfRangeException |
Record index must be > 0.
|
InvalidOperationException |
Cannot move to a previous record in forward-only mode.
|
EndOfStreamException |
Cannot read record at record .
|
MalformedCsvException |
The CSV appears to be corrupt at the current position.
|
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
Item[Int32, String]
Gets the field with the specified name and record position. hasHeaders must be
true.
Declaration
public string this[int record, string field] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
record |
|
System.String |
field |
|
Property Value
Type |
Description |
System.String |
The field with the specified name and record position.
|
Exceptions
Type |
Condition |
ArgumentNullException |
field is null or an empty string.
|
InvalidOperationException |
The CSV does not have headers (HasHeaders property is false).
|
ArgumentException |
field not found.
|
ArgumentOutOfRangeException |
Record index must be > 0.
|
InvalidOperationException |
Cannot move to a previous record in forward-only mode.
|
EndOfStreamException |
Cannot read record at record .
|
MalformedCsvException |
The CSV appears to be corrupt at the current position.
|
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
MissingFieldAction
Gets or sets the action to take when a field is missing.
Declaration
public MissingFieldAction MissingFieldAction { get; set; }
Property Value
|
Improve this Doc
View Source
MissingFieldFlag
Indicates if one or more field are missing for the current record.
Resets after each successful record read.
Declaration
public bool MissingFieldFlag { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ParseErrorFlag
Indicates if a parse error occurred for the current record.
Resets after each successful record read.
Declaration
public bool ParseErrorFlag { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Quote
Gets the quotation character wrapping
every field. Default is '"'.
Declaration
public char Quote { get; set; }
Property Value
Type |
Description |
System.Char |
The quotation character wrapping every field. |
|
Improve this Doc
View Source
SkipEmptyLines
Gets or sets a value indicating if the reader will skip empty lines.
Declaration
public bool SkipEmptyLines { get; set; }
Property Value
Type |
Description |
System.Boolean |
A value indicating if the reader will skip empty lines. |
|
Improve this Doc
View Source
SupportsMultiline
Gets or sets a value indicating if the reader supports multiline fields.
Declaration
public bool SupportsMultiline { get; set; }
Property Value
Type |
Description |
System.Boolean |
A value indicating if the reader supports multiline field. |
|
Improve this Doc
View Source
TrimmingOption
Indicates if spaces at the start and end of a field
are trimmed. Default is to trim unquoted fields only.
Declaration
public ValueTrimmingOptions TrimmingOption { get; set; }
Property Value
Type |
Description |
ValueTrimmingOptions |
true if spaces at the start and end of a field are trimmed, otherwise,
false.
|
Methods
|
Improve this Doc
View Source
Close()
Closes the System.Data.IDataReader Object.
Declaration
|
Improve this Doc
View Source
CopyCurrentRecordTo(String[], Int32)
Copies the field array of the current record to a one-dimensional array, starting at the beginning of the target
array.
Declaration
public void CopyCurrentRecordTo(string[] array, int index)
Parameters
Type |
Name |
Description |
System.String[] |
array |
The one-dimensional Array that is the destination of the fields of the current
record.
|
System.Int32 |
index |
The zero-based index in array at which copying begins. |
Exceptions
Type |
Condition |
ArgumentNullException |
array is null.
|
ArgumentOutOfRangeException |
index is les than zero or is equal to or greater than the length array .
|
System.InvalidOperationException |
No current record.
|
System.ArgumentException |
The number of fields in the record is greater than the available space from index to the end of
array .
|
|
Improve this Doc
View Source
CopyCurrentRecordTo(String[])
Copies the field array of the current record to a one-dimensional array, starting at the beginning of the target
array.
Declaration
public void CopyCurrentRecordTo(string[] array)
Parameters
Type |
Name |
Description |
System.String[] |
array |
The one-dimensional Array that is the destination of the fields of the current
record.
|
Exceptions
Type |
Condition |
ArgumentNullException |
array is null.
|
|
Improve this Doc
View Source
Dispose()
Releases all resources used by the instance.
Declaration
|
Improve this Doc
View Source
Finalize()
Releases unmanaged resources and performs other cleanup operations before the instance is reclaimed by garbage
collection.
Declaration
protected void Finalize()
|
Improve this Doc
View Source
FromText(String, Boolean, Char)
Creates a new CsvReader to read from a string including a custom delimeter.
Declaration
public static CsvReader FromText(string text, bool hasHeaders, char delimiter)
Parameters
Type |
Name |
Description |
System.String |
text |
The text containing the fields in the CSV format. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
System.Char |
delimiter |
The delimiter to separate cells in the table. |
Returns
|
Improve this Doc
View Source
FromText(String, Boolean)
Creates a new CsvReader to read from a string.
Declaration
public static CsvReader FromText(string text, bool hasHeaders)
Parameters
Type |
Name |
Description |
System.String |
text |
The text containing the fields in the CSV format. |
System.Boolean |
hasHeaders |
true if field names are located on the first non commented line, otherwise,
false.
|
Returns
|
Improve this Doc
View Source
GetDelimiter(String, Nullable<Char>)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
public static char GetDelimiter(string file, char? csvDelimiter)
Parameters
Type |
Name |
Description |
System.String |
file |
|
System.Nullable<System.Char> |
csvDelimiter |
|
Returns
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
GetEnumerator()
Returns an RecordEnumerator that can iterate through CSV records.
Declaration
public CsvReader.RecordEnumerator GetEnumerator()
Returns
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
Gets the field headers.
Declaration
public string[] GetFieldHeaders()
Returns
Type |
Description |
System.String[] |
The field headers or an empty array if headers are not supported. |
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
GetFieldIndex(String)
Gets the field index for the provided header.
Declaration
public int GetFieldIndex(string header)
Parameters
Type |
Name |
Description |
System.String |
header |
The header to look for. |
Returns
Type |
Description |
System.Int32 |
The field index for the provided header. -1 if not found. |
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
MapData(String, Nullable<Char>, Boolean, Char, Char, Char)
Converts the input CSV file into a System.Data.DataTable with column names
according to the optional header row or a default description (Column_0, ..).
Declaration
public static DataTable MapData(string file, char? csvDelimiter = null, bool hasHeader = true, char comment = '#', char escape = '"', char quote = '"')
Parameters
Type |
Name |
Description |
System.String |
file |
Input CSV file or whole text. |
System.Nullable<System.Char> |
csvDelimiter |
The delimiter to separate the value or null if the delimiter shall be inferred. |
System.Boolean |
hasHeader |
The flag indicating that first line and text has describing header. |
System.Char |
comment |
The comment character indicating that a line is commented out. |
System.Char |
escape |
The escape character letting insert quotation characters inside a quoted field. |
System.Char |
quote |
The quote character wrapping every field. |
Returns
Type |
Description |
System.Data.DataTable |
A System.Data.DataTable containing all rows and columns of the input csv file otherwise null if input file
is null.
|
Exceptions
Type |
Condition |
System.ArgumentException |
The files does not exist |
|
Improve this Doc
View Source
MapText(String, Nullable<Char>, Boolean, Char, Char, Char)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
public static DataTable MapText(string input, char? csvDelimiter = null, bool hasHeader = true, char comment = '#', char escape = '"', char quote = '"')
Parameters
Type |
Name |
Description |
System.String |
input |
|
System.Nullable<System.Char> |
csvDelimiter |
|
System.Boolean |
hasHeader |
|
System.Char |
comment |
|
System.Char |
escape |
|
System.Char |
quote |
|
Returns
Type |
Description |
System.Data.DataTable |
|
|
Improve this Doc
View Source
MoveTo(Int64)
Moves to the specified record index.
Declaration
public bool MoveTo(long record)
Parameters
Type |
Name |
Description |
System.Int64 |
record |
The record index. |
Returns
Type |
Description |
System.Boolean |
true if the operation was successful; otherwise, false . |
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
ReadLine()
Reads the entire stream into a list of records.
Declaration
public string[] ReadLine()
Returns
Type |
Description |
System.String[] |
A list containing all records in the file. |
|
Improve this Doc
View Source
ReadNextRecord()
Reads the next record.
Declaration
public bool ReadNextRecord()
Returns
Type |
Description |
System.Boolean |
true if a record has been successfully reads; otherwise, false. |
Exceptions
Type |
Condition |
System.ComponentModel.ObjectDisposedException |
The instance has been disposed of.
|
|
Improve this Doc
View Source
ReadToEnd()
Reads the entire stream into a list of records.
Declaration
public List<string[]> ReadToEnd()
Returns
Type |
Description |
System.Collections.Generic.List<System.String[]> |
A list containing all records in the file. |
|
Improve this Doc
View Source
ToJagged()
Reads the entire stream into a jagged matrix.
Declaration
public double[][] ToJagged()
Returns
Type |
Description |
System.Double[][] |
|
|
Improve this Doc
View Source
ToJagged<T>()
Reads the entire stream into a jagged matrix.
Declaration
public T[][] ToJagged<T>()
Returns
Type Parameters
|
Improve this Doc
View Source
ToMatrix()
Reads the entire stream into a multi-dimensional matrix.
Declaration
public double[, ] ToMatrix()
Returns
Type |
Description |
System.Double[,] |
|
|
Improve this Doc
View Source
ToMatrix<T>()
Reads the entire stream into a multi-dimensional matrix.
Declaration
public T[, ] ToMatrix<T>()
Returns
Type Parameters
|
Improve this Doc
View Source
ToTable()
Reads the entire stream into a DataTable.
Declaration
public DataTable ToTable()
Returns
Type |
Description |
System.Data.DataTable |
A System.DataTable containing the read values. |
|
Improve this Doc
View Source
ToTable(String[])
Reads the entire stream into a DataTable.
Declaration
public DataTable ToTable(params string[] columnNames)
Parameters
Type |
Name |
Description |
System.String[] |
columnNames |
|
Returns
Type |
Description |
System.Data.DataTable |
A System.DataTable containing the read values. |
Events
|
Improve this Doc
View Source
Disposed
Occurs when the instance is disposed of.
Declaration
public event EventHandler Disposed
Event Type
Type |
Description |
System.EventHandler |
|
|
Improve this Doc
View Source
ParseError
Occurs when there is an error while parsing the CSV stream.
Declaration
public event EventHandler<ParseErrorEventArgs> ParseError
Event Type
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable<String[]>.GetEnumerator()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
IEnumerator<string[]> IEnumerable<string[]>.GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<System.String[]> |
|
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
|
Improve this Doc
View Source
IDataReader.Close()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
|
Improve this Doc
View Source
IDataReader.Depth
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
int IDataReader.Depth { get; }
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IDataReader.GetSchemaTable()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
DataTable IDataReader.GetSchemaTable()
Returns
Type |
Description |
System.Data.DataTable |
|
|
Improve this Doc
View Source
IDataReader.IsClosed
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
bool IDataReader.IsClosed { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IDataReader.NextResult()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
bool IDataReader.NextResult()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IDataReader.Read()
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IDataReader.RecordsAffected
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
int IDataReader.RecordsAffected { get; }
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IDataRecord.GetBoolean(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
bool IDataRecord.GetBoolean(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IDataRecord.GetByte(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
byte IDataRecord.GetByte(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Byte |
|
|
Improve this Doc
View Source
IDataRecord.GetBytes(Int32, Int64, Byte[], Int32, Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
long IDataRecord.GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int64 |
fieldOffset |
|
System.Byte[] |
buffer |
|
System.Int32 |
bufferoffset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
IDataRecord.GetChar(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
char IDataRecord.GetChar(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Char |
|
|
Improve this Doc
View Source
IDataRecord.GetChars(Int32, Int64, Char[], Int32, Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
long IDataRecord.GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
System.Int64 |
fieldoffset |
|
System.Char[] |
buffer |
|
System.Int32 |
bufferoffset |
|
System.Int32 |
length |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
IDataRecord.GetData(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
IDataReader IDataRecord.GetData(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
|
Improve this Doc
View Source
IDataRecord.GetDataTypeName(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
string IDataRecord.GetDataTypeName(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
IDataRecord.GetDateTime(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
DateTime IDataRecord.GetDateTime(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.DateTime |
|
|
Improve this Doc
View Source
IDataRecord.GetDecimal(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
decimal IDataRecord.GetDecimal(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Decimal |
|
|
Improve this Doc
View Source
IDataRecord.GetDouble(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
double IDataRecord.GetDouble(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
IDataRecord.GetFieldType(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
Type IDataRecord.GetFieldType(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Type |
|
|
Improve this Doc
View Source
IDataRecord.GetFloat(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
float IDataRecord.GetFloat(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
IDataRecord.GetGuid(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
Guid IDataRecord.GetGuid(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Guid |
|
|
Improve this Doc
View Source
IDataRecord.GetInt16(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
short IDataRecord.GetInt16(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int16 |
|
|
Improve this Doc
View Source
IDataRecord.GetInt32(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
int IDataRecord.GetInt32(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IDataRecord.GetInt64(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
long IDataRecord.GetInt64(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
IDataRecord.GetName(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
string IDataRecord.GetName(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
IDataRecord.GetOrdinal(String)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
int IDataRecord.GetOrdinal(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IDataRecord.GetString(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
string IDataRecord.GetString(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
IDataRecord.GetValue(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
object IDataRecord.GetValue(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
IDataRecord.GetValues(Object[])
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
int IDataRecord.GetValues(object[] values)
Parameters
Type |
Name |
Description |
System.Object[] |
values |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
IDataRecord.IsDBNull(Int32)
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
bool IDataRecord.IsDBNull(int i)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IDataRecord.Item[Int32]
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
object IDataRecord.this[int i] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
i |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
IDataRecord.Item[String]
Represents a reader that provides fast, non-cached, forward-only access to CSV data.
Declaration
object IDataRecord.this[string name] { get; }
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.Object |
|
Implements
System.Data.IDataReader
System.Data.IDataRecord
System.IDisposable
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods