Table of Contents

Class BulkCopyReader

Namespace
LinqToDB.DataProvider
Assembly
linq2db.dll
public abstract class BulkCopyReader : DbDataReader, IDataReader, IDisposable, IDataRecord, IEnumerable
Inheritance
BulkCopyReader
Implements
Derived
Inherited Members
Extension Methods

Constructors

BulkCopyReader(DataConnection, List<ColumnDescriptor>)

protected BulkCopyReader(DataConnection dataConnection, List<ColumnDescriptor> columns)

Parameters

dataConnection DataConnection
columns List<ColumnDescriptor>

Fields

Count

public int Count

Field Value

int

Properties

Current

protected abstract object Current { get; }

Property Value

object

Depth

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

public override int Depth { get; }

Property Value

int

The depth of nesting for the current row.

FieldCount

Gets the number of columns in the current row.

public override int FieldCount { get; }

Property Value

int

The number of columns in the current row.

Exceptions

NotSupportedException

There is no current connection to an instance of SQL Server.

HasRows

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

public override bool HasRows { get; }

Property Value

bool

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

IsClosed

Gets a value indicating whether the DbDataReader is closed.

public override bool IsClosed { get; }

Property Value

bool

true if the DbDataReader is closed; otherwise false.

Exceptions

InvalidOperationException

The SqlDataReader is closed.

this[int]

Gets the value of the specified column as an instance of object.

public override object this[int i] { get; }

Parameters

i int

Property Value

object

The value of the specified column.

Exceptions

IndexOutOfRangeException

The index passed was outside the range of 0 through FieldCount.

this[string]

Gets the value of the specified column as an instance of object.

public override object this[string name] { get; }

Parameters

name string

The name of the column.

Property Value

object

The value of the specified column.

Exceptions

IndexOutOfRangeException

No column with the specified name was found.

RecordsAffected

Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

public override int RecordsAffected { get; }

Property Value

int

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

Methods

Close()

Closes the DbDataReader object.

public override void Close()

GetBoolean(int)

Gets the value of the specified column as a Boolean.

public override bool GetBoolean(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

bool

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetByte(int)

Gets the value of the specified column as a byte.

public override byte GetByte(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

byte

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetBytes(int, long, byte[]?, int, int)

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.

public override long GetBytes(int ordinal, long dataOffset, byte[]? buffer, int bufferOffset, int length)

Parameters

ordinal int

The zero-based column ordinal.

dataOffset long

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

buffer byte[]

The buffer into which to copy the data.

bufferOffset int

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

length int

The maximum number of characters to read.

Returns

long

The actual number of bytes read.

Exceptions

InvalidCastException

The specified cast is not valid.

GetChar(int)

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

public override char GetChar(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

char

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetChars(int, long, char[]?, int, int)

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.

public override long GetChars(int ordinal, long dataOffset, char[]? buffer, int bufferOffset, int length)

Parameters

ordinal int

The zero-based column ordinal.

dataOffset long

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

buffer char[]

The buffer into which to copy the data.

bufferOffset int

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

length int

The maximum number of characters to read.

Returns

long

The actual number of characters read.

GetDataTypeName(int)

Gets name of the data type of the specified column.

public override string GetDataTypeName(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

string

A string representing the name of the data type.

Exceptions

InvalidCastException

The specified cast is not valid.

GetDateTime(int)

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

public override DateTime GetDateTime(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

DateTime

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetDecimal(int)

Gets the value of the specified column as a decimal object.

public override decimal GetDecimal(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

decimal

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetDouble(int)

Gets the value of the specified column as a double-precision floating point number.

public override double GetDouble(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

double

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetEnumerator()

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

public override IEnumerator GetEnumerator()

Returns

IEnumerator

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

GetFieldType(int)

Gets the data type of the specified column.

public override Type GetFieldType(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

Type

The data type of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetFloat(int)

Gets the value of the specified column as a single-precision floating point number.

public override float GetFloat(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

float

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetGuid(int)

Gets the value of the specified column as a globally-unique identifier (GUID).

public override Guid GetGuid(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

Guid

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetInt16(int)

Gets the value of the specified column as a 16-bit signed integer.

public override short GetInt16(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

short

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetInt32(int)

Gets the value of the specified column as a 32-bit signed integer.

public override int GetInt32(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

int

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetInt64(int)

Gets the value of the specified column as a 64-bit signed integer.

public override long GetInt64(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

long

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetName(int)

Gets the name of the column, given the zero-based column ordinal.

public override string GetName(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

string

The name of the specified column.

GetOrdinal(string)

Gets the column ordinal given the name of the column.

public override int GetOrdinal(string name)

Parameters

name string

The name of the column.

Returns

int

The zero-based column ordinal.

Exceptions

IndexOutOfRangeException

The name specified is not a valid column name.

GetSchemaTable()

Returns a DataTable that describes the column metadata of the DbDataReader.

public override DataTable GetSchemaTable()

Returns

DataTable

A DataTable that describes the column metadata.

Exceptions

InvalidOperationException

The SqlDataReader is closed.

GetString(int)

Gets the value of the specified column as an instance of string.

public override string GetString(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

string

The value of the specified column.

Exceptions

InvalidCastException

The specified cast is not valid.

GetValue(int)

Gets the value of the specified column as an instance of object.

public override object GetValue(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

object

The value of the specified column.

GetValues(object?[])

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

public override int GetValues(object?[] values)

Parameters

values object[]

An array of object into which to copy the attribute columns.

Returns

int

The number of instances of object in the array.

IsDBNull(int)

Gets a value that indicates whether the column contains nonexistent or missing values.

public override bool IsDBNull(int ordinal)

Parameters

ordinal int

The zero-based column ordinal.

Returns

bool

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

MoveNext()

protected abstract bool MoveNext()

Returns

bool

NextResult()

Advances the reader to the next result when reading the results of a batch of statements.

public override bool NextResult()

Returns

bool

true if there are more result sets; otherwise false.

Read()

Advances the reader to the next record in a result set.

public override bool Read()

Returns

bool

true if there are more rows; otherwise false.