November Happy Hour will be moved to Thursday December 5th.

Class ObjectArrayDataReader<T>

Represents object array data reader.

Inheritance
System.Object
ObjectArrayDataReader<T>
Implements
System.Data.IDataReader
System.IDisposable
System.Data.IDataRecord
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 12.17.2
Syntax
public class ObjectArrayDataReader<T> : IDataReader, IDisposable, IDataRecord
Type Parameters
Name Description
T

Constructors

ObjectArrayDataReader(T[])

Initializes a new instance of the ObjectArrayDataReader class.

Declaration
public ObjectArrayDataReader(T[] array)
Parameters
Type Name Description
T[] array

The array.

Properties

Depth

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

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

FieldCount

Gets the number of columns in the current row.

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

Index

Gets the index.

Declaration
protected int Index { get; }
Property Value
Type Description
System.Int32

The index.

InnerArray

Gets the inner array.

Declaration
protected T[] InnerArray { get; }
Property Value
Type Description
T[]

The inner array.

IsClosed

Gets a value indicating whether the data reader is closed.

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

Item[Int32]

Gets the Object with the specified i.

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

Item[String]

Gets the Object with the specified name.

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

RecordsAffected

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

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

Methods

Close()

Closes the System.Data.IDataReader 0bject.

Declaration
public void Close()

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

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

GetBoolean(Int32)

Gets the value of the specified column as a Boolean.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetByte(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

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

Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.

Declaration
public 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 field from which to start the read operation.

System.Byte[] buffer

The buffer into which to read the stream of bytes.

System.Int32 bufferoffset

The index for buffer to start the read operation.

System.Int32 length

The number of bytes to read.

Returns
Type Description
System.Int64

The actual number of bytes read.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetChar(Int32)

Gets the character value of the specified column.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

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

Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset.

Declaration
public 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 start the read operation.

System.Char[] buffer

The buffer into which to read the stream of bytes.

System.Int32 bufferoffset

The index for buffer to start the read operation.

System.Int32 length

The number of bytes to read.

Returns
Type Description
System.Int64

The actual number of characters read.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetData(Int32)

Gets an System.Data.IDataReader to be used when the field points to more remote structured data.

Declaration
public IDataReader GetData(int i)
Parameters
Type Name Description
System.Int32 i

The index of the field to find.

Returns
Type Description
System.Data.IDataReader

An System.Data.IDataReader to be used when the field points to more remote structured data.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetDataTypeName(Int32)

Gets the data type information for the specified field.

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

The index of the field to find.

Returns
Type Description
System.String

The data type information for the specified field.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetDateTime(Int32)

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

Declaration
public 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 spcified field.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetDecimal(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetDouble(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetFieldType(Int32)

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

Declaration
public 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(System.Int32).

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetFloat(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetGuid(Int32)

Returns the GUID value of the specified field.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetInt16(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetInt32(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetInt64(Int32)

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

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetName(Int32)

Gets the name for the field to find.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetNextIndex()

Gets the index of the next.

Declaration
protected bool GetNextIndex()
Returns
Type Description
System.Boolean

GetOrdinal(String)

Return the index of the named field.

Declaration
public 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.

GetProperties()

Gets the properties.

Declaration
protected PropertyInfo[] GetProperties()
Returns
Type Description
System.Reflection.PropertyInfo[]

GetSchemaTable()

Returns a System.Data.DataTable that describes the column metadata of the System.Data.IDataReader.

Declaration
public DataTable GetSchemaTable()
Returns
Type Description
System.Data.DataTable

A System.Data.DataTable that describes the column metadata.

Exceptions
Type Condition
System.InvalidOperationException

The System.Data.IDataReader is closed.

GetString(Int32)

Gets the string value of the specified field.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetValue(Int32)

Return the value of the specified field.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

GetValues(Object[])

Gets all the attribute fields in the collection for the current record.

Declaration
public 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.

IsDBNull(Int32)

Return whether the specified field is set to null.

Declaration
public 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.

Exceptions
Type Condition
System.IndexOutOfRangeException

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

NextResult()

Declaration
public bool NextResult()
Returns
Type Description
System.Boolean

Read()

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

Declaration
public bool Read()
Returns
Type Description
System.Boolean

true if there are more rows; otherwise, false.

ThrowIfDataReaderWasClosed()

Throws if data reader is closed.

Declaration
protected void ThrowIfDataReaderWasClosed()

Implements

System.Data.IDataReader
System.IDisposable
System.Data.IDataRecord