Class BaseDataReader
Reads a forward-only stream of rows.
Inherited Members
Namespace: IRM.Data
Assembly: IRM.dll
Syntax
public abstract class BaseDataReader : IDataReader, IDisposable, IDataRecord
Constructors
BaseDataReader()
BaseDataReader(Boolean)
Initializes a new instance of the BaseDataReader class.
Declaration
protected BaseDataReader(bool parseToDefinedType)
Parameters
Boolean
parseToDefinedType
|
Properties
Depth
Gets a value indicating the depth of nesting for the current row.
Declaration
public int Depth { get; }
Property Value
System.Int32
The level of nesting. |
Implements
FieldCount
Gets the number of columns in the current row.
Declaration
public abstract int FieldCount { get; }
Property Value
System.Int32
When not positioned in a valid recordset, 0; otherwise, the number of columns in the current record. The default is -1. |
Implements
IsClosed
Gets a value indicating whether the data reader is closed.
Declaration
public abstract bool IsClosed { get; }
Property Value
Boolean
true if the data reader is closed; otherwise, false. |
Implements
IsDisposed
Gets a value indicating whether the instance has been disposed of.
Declaration
[Browsable(false)]
public bool IsDisposed { get; }
Property Value
Boolean
true if the instance has been disposed of; otherwise, false. |
Item[Int32]
Gets the value of the column located at the specified index as a string.
Declaration
public abstract string this[int index] { get; }
Parameters
System.Int32
index
The zero-based index of the column to get. |
Property Value
String
The value of the column located at the specified index as a string |
Item[String]
Gets the value of the column with the specified name as a string.
Declaration
public abstract string this[string name] { get; }
Parameters
String
name
The name of the column to find. |
Property Value
String
The value of the column with the specified name as a string. |
RecordsAffected
Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
Declaration
public int RecordsAffected { get; }
Property Value
System.Int32
The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements. |
Implements
Methods
CheckDisposed()
Checks if the instance has been disposed of, and if it has, throws an System.ObjectDisposedException; otherwise, does nothing.
Declaration
protected void CheckDisposed()
Remarks
Derived classes should call this method at the start of all methods and properties that should not be accessed after a call to Dispose().
Exceptions
System.ObjectDisposedException
The instance has been disposed of. |
Close()
Closes the System.Data.IDataReader Object.
Declaration
public virtual void Close()
Implements
Dispose()
Releases all resources used by the instance.
Declaration
public void Dispose()
Implements
Remarks
Calls Dispose(Boolean) with the disposing parameter set to true to free unmanaged and managed resources.
Dispose(Boolean)
Releases the unmanaged resources used by this instance and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Boolean
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Finalize()
GetBoolean(Int32)
Gets the value of the specified column as a Boolean.
Declaration
public virtual bool GetBoolean(int i)
Parameters
System.Int32
i
The zero-based column ordinal. |
Returns
Boolean
The value of the column. |
Implements
GetByte(Int32)
Gets the 8-bit unsigned integer value of the specified column.
Declaration
public virtual byte GetByte(int i)
Parameters
System.Int32
i
The zero-based column ordinal. |
Returns
System.Byte
The 8-bit unsigned integer value of the specified column. |
Implements
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 virtual long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
Parameters
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
System.Int64
The actual number of bytes read. |
Implements
GetChar(Int32)
Gets the character value of the specified column.
Declaration
public virtual char GetChar(int i)
Parameters
System.Int32
i
The zero-based column ordinal. |
Returns
Char
The character value of the specified column. |
Implements
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 virtual long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
Parameters
System.Int32
i
The zero-based column ordinal. |
System.Int64
fieldoffset
The index within the row from which to start the read operation. |
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
System.Int64
The actual number of characters read. |
Implements
GetData(Int32)
Returns an System.Data.IDataReader for the specified column ordinal.
Declaration
public virtual IDataReader GetData(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Data.IDataReader
The System.Data.IDataReader for the specified column ordinal. |
Implements
GetDataTypeName(Int32)
Gets the data type information for the specified field.
Declaration
public virtual string GetDataTypeName(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
String
The data type information for the specified field. |
Implements
GetDateTime(Int32)
Gets the date and time data value of the specified field.
Declaration
public virtual DateTime GetDateTime(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.DateTime
The date and time data value of the specified field. |
Implements
GetDecimal(Int32)
Gets the fixed-position numeric value of the specified field.
Declaration
public virtual decimal GetDecimal(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Decimal
The fixed-position numeric value of the specified field. |
Implements
GetDouble(Int32)
Gets the double-precision floating point number of the specified field.
Declaration
public virtual double GetDouble(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Double
The double-precision floating point number of the specified field. |
Implements
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 abstract Type GetFieldType(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Type
The System.Type information corresponding to the type of System.Object that would be returned from System.Data.IDataRecord.GetValue(System.Int32). |
Implements
GetFloat(Int32)
Gets the single-precision floating point number of the specified field.
Declaration
public virtual float GetFloat(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Single
The single-precision floating point number of the specified field. |
Implements
GetGuid(Int32)
Returns the GUID value of the specified field.
Declaration
public virtual Guid GetGuid(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Guid
The GUID value of the specified field. |
Implements
GetInt16(Int32)
Gets the 16-bit signed integer value of the specified field.
Declaration
public virtual short GetInt16(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Int16
The 16-bit signed integer value of the specified field. |
Implements
GetInt32(Int32)
Gets the 32-bit signed integer value of the specified field.
Declaration
public virtual int GetInt32(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Int32
The 32-bit signed integer value of the specified field. |
Implements
GetInt64(Int32)
Gets the 64-bit signed integer value of the specified field.
Declaration
public virtual long GetInt64(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Int64
The 64-bit signed integer value of the specified field. |
Implements
GetName(Int32)
Gets the name for the field to find.
Declaration
public abstract string GetName(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
String
The name of the field or the empty string (""), if there is no value to return. |
Implements
GetNullableInt32(Int32)
Gets the nullable 32-bit signed integer value of the specified field.
Declaration
public int? GetNullableInt32(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
System.Nullable<System.Int32>
The nullable 32-bit signed integer value of the specified field. |
GetOrdinal(String)
Return the index of the named field.
Declaration
public abstract int GetOrdinal(string name)
Parameters
String
name
The name of the field to find. |
Returns
System.Int32
The index of the named field. |
Implements
GetSchemaTable()
Returns a System.Data.DataTable that describes the column metadata of the System.Data.IDataReader.
Declaration
public virtual DataTable GetSchemaTable()
Returns
System.Data.DataTable
A System.Data.DataTable that describes the column metadata. |
Implements
GetString(Int32)
Gets the string value of the specified field.
Declaration
public virtual string GetString(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
String
The string value of the specified field. |
Implements
GetValue(Int32)
Return the value of the specified field.
Declaration
public virtual object GetValue(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
Object
The System.Object which will contain the field value upon return. |
Implements
GetValues(Object[])
Populates an array of objects with the column values of the current record.
Declaration
public virtual int GetValues(object[] values)
Parameters
Object[]
values
An array of System.Object to copy the attribute fields into. |
Returns
System.Int32
The number of instances of System.Object in the array. |
Implements
IsDBNull(Int32)
Return whether the specified field is set to null.
Declaration
public virtual bool IsDBNull(int i)
Parameters
System.Int32
i
The index of the field to find. |
Returns
Boolean
true if the specified field is set to null; otherwise, false. |
Implements
NextResult()
Advances the data reader to the next result, when reading the results of batch SQL statements.
Declaration
public virtual bool NextResult()
Returns
Boolean
true if there are more results; otherwise, false. |
Implements
OnDisposed(EventArgs)
Raises the Disposed event.
Declaration
protected virtual void OnDisposed(EventArgs e)
Parameters
System.EventArgs
e
A System.EventArgs that contains the event data. |
Read()
Advances the System.Data.IDataReader to the next record.
Declaration
public abstract bool Read()
Returns
Boolean
true if there are more rows; otherwise, false. |
Implements
Events
Disposed
Occurs when the instance is disposed of.
Declaration
public event EventHandler Disposed
Event Type
System.EventHandler
|
Explicit Interface Implementations
IDataRecord.Item[Int32]
Gets the value value of the column located at the specified index as an System.Object.
Declaration
object IDataRecord.this[int index] { get; }
Parameters
System.Int32
index
The zero-based index of the column to get. |
Returns
Object
The value of the column located at the specified index as an System.Object. |
Implements
IDataRecord.Item[String]
Gets the value of the column with the specified name as an System.Object.
Declaration
object IDataRecord.this[string name] { get; }
Parameters
String
name
The name of the column to find. |
Returns
Object
The value of the column with the specified name as an System.Object. |