Show / Hide Table of Contents

Class SoDataReader

Implements the IDataReader interface.

Inheritance
Object
MarshalByRefObject
SoDataReader
Implements
IDataReader
IDisposable
IDataRecord
ISoDataLookup
ISentryIgnorable
IEnumerable
ISoDataRecord
Inherited Members
MarshalByRefObject.MemberwiseClone(Boolean)
MarshalByRefObject.GetLifetimeService()
MarshalByRefObject.InitializeLifetimeService()
MarshalByRefObject.CreateObjRef(Type)
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
public sealed class SoDataReader : MarshalByRefObject, IDataReader, IDisposable, IDataRecord, ISoDataLookup, ISentryIgnorable, IEnumerable, ISoDataRecord

Properties

DbRowsRead

Return the number of rows actually read from the database. Note that this value may be larger than the number of rows visible to the caller, since there may be a Sentry in there eating rows that should not be visible, and skipping may have been done in order to reach a certain page.

Declaration
public int DbRowsRead { get; }
Property Value
Type Description
Int32

rows read.

Depth

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

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

FieldCount

Gets the number of columns in the current row.

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

IsAutoClose

Shall the reader be automatically closed when the last row is read (e.g. Read() returning false).

Declaration
public bool IsAutoClose { get; set; }
Property Value
Type Description
Boolean

IsClosed

The reader state. Calling Close() on the reader will cause get methods to stop working, and set this to true.

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

IsSentryIgnored

Get value indicating whether sentry is ignored on the current object for the current thread.

Declaration
public bool IsSentryIgnored { get; }
Property Value
Type Description
Boolean

Item[FieldInfo]

Returns the value of the first matching field. Returns NULL if no field is found.

Declaration
public object this[FieldInfo fieldInfo] { get; }
Parameters
Type Name Description
FieldInfo fieldInfo
Property Value
Type Description
Object

Item[Int32]

Return value at column position. First column = 0.

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

If the column is hidden by a sentry then null is returned instead of the value.

Item[String]

Return value at named column.

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

If the column is hidden by a sentry then null is returned instead of the value.

Reader

Declaration
public SoDataReader Reader { get; }
Property Value
Type Description
SoDataReader

RecordsAffected

RecordsAffected is only applicable to batch statements that include inserts/updates/deletes.

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

Sentries

The datareaders sentry-collection.

Declaration
public SentryCollection Sentries { get; }
Property Value
Type Description
SentryCollection

The sentries.

Methods

BeginIgnoreSentryCheck()

Starts the process of ignoring sentry on the object implementing the interface on the current thread.

Declaration
public IgnoreSentryCheck BeginIgnoreSentryCheck()
Returns
Type Description
IgnoreSentryCheck

Disposable object that calls EndIgnoreSentryCheck() on Dispose.

Close()

Closes the IDataReader 0bject.

Declaration
public void Close()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

EndIgnoreSentryCheck()

Ends the process of ignoring sentry on the object implementing the interface on the current thread.

Declaration
public void EndIgnoreSentryCheck()
Exceptions
Type Condition
SoException

Thrown if Sentry is not ignored.

GetBoolean(FieldInfo)

Gets the value of the specified column as a bool.

Declaration
public bool GetBoolean(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Boolean

Boolean value

Remarks

Returns false if the column is hidden by a sentry

GetBoolean(Int32)

Gets the value of the specified column as a bool.

Declaration
public bool GetBoolean(int i)
Parameters
Type Name Description
Int32 i

column index

Returns
Type Description
Boolean
Remarks

Returns false if the column is hidden by a sentry

GetBoolean(String)

Gets the value of the specified column as a bool.

Declaration
public bool GetBoolean(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Boolean

Boolean value

Remarks

Returns false if the column is hidden by a sentry

GetByte(FieldInfo)

Gets the value of the specified column as a byte.

Declaration
public byte GetByte(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Byte
Remarks

Returns 0 if the column is hidden by a sentry

GetByte(Int32)

Gets the value of the specified column as a byte.

Declaration
public byte GetByte(int i)
Parameters
Type Name Description
Int32 i

column index

Returns
Type Description
Byte
Remarks

Returns 0 if the column is hidden by a sentry

GetByte(String)

Gets the value of the specified column as a byte.

Declaration
public byte GetByte(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Byte
Remarks

Returns 0 if the column is hidden by a sentry

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

Reads a stream of bytes from the specified column offset into the buffer 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
Int32 i

Column index

Int64 fieldOffset
Byte[] buffer
Int32 bufferoffset
Int32 length
Returns
Type Description
Int64
Remarks

Returns 0 if the column is hidden by a sentry

GetChar(FieldInfo)

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

Declaration
public char GetChar(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Char
Remarks

Returns 0 if the column is hidden by a sentry

GetChar(Int32)

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

Declaration
public char GetChar(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Char
Remarks

Returns 0 if the column is hidden by a sentry

GetChar(String)

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

Declaration
public char GetChar(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Char
Remarks

Returns 0 if the column is hidden by a sentry

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
Int32 i

Column index

Int64 fieldoffset
Char[] buffer
Int32 bufferoffset
Int32 length
Returns
Type Description
Int64
Remarks

Returns 0 if the column is hidden by a sentry

GetData(Int32)

Returns a reader to the given column - usually used to access nested tables.

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

Column index

Returns
Type Description
IDataReader
Remarks

Returns null if the column is hidden by a sentry

GetDataTypeName(Int32)

Return the name of the datatype of the i'th column

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

0-based index.

Returns
Type Description
String

Name of the data type in the column. for example: "int" or "varchar"

Exceptions
Type Condition
IndexOutOfRangeException

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

GetDateTime(FieldInfo)

Gets the value of the specified column as a DateTime.

Declaration
public DateTime GetDateTime(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
DateTime
Remarks

Returns DateTime.MinValue if the column is hidden by a sentry

GetDateTime(Int32)

Gets the value of the specified column as a DateTime.

Declaration
public DateTime GetDateTime(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
DateTime
Remarks

Returns DateTime.MinValue if the column is hidden by a sentry

GetDateTime(String)

Gets the value of the specified column as a DateTime.

Declaration
public DateTime GetDateTime(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
DateTime
Remarks

Returns DateTime.MinValue if the column is hidden by a sentry

GetDecimal(FieldInfo)

Gets the value of the specified column as a decimal.

Declaration
public decimal GetDecimal(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Decimal
Remarks

Returns Zero if the column is hidden by a sentry

GetDecimal(Int32)

Gets the value of the specified column as a decimal.

Declaration
public decimal GetDecimal(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Decimal
Remarks

Returns Zero if the column is hidden by a sentry

GetDecimal(String)

Gets the value of the specified column as a decimal.

Declaration
public decimal GetDecimal(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Decimal
Remarks

Returns Zero if the column is hidden by a sentry

GetDouble(FieldInfo)

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

Declaration
public double GetDouble(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Double
Remarks

Returns NaN if the column is hidden by a sentry

GetDouble(Int32)

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

Declaration
public double GetDouble(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Double
Remarks

Returns NaN if the column is hidden by a sentry

GetDouble(String)

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

Declaration
public double GetDouble(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Double
Remarks

Returns NaN if the column is hidden by a sentry

GetEnum<E>(FieldInfo)

Get a field from an int16-compatible database value and parse it as the given enum

Declaration
public E GetEnum<E>(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Field specification

Returns
Type Description
E

Enum value, or default(E) if sentry blocks reading

Type Parameters
Name Description
E

The enum type to return

GetEnum<E>(Int32)

Get a field from an int16-compatible database value and parse it as the given enum

Declaration
public E GetEnum<E>(int index)
Parameters
Type Name Description
Int32 index

Field specification

Returns
Type Description
E

Enum value, or default(E) if sentry blocks reading

Type Parameters
Name Description
E

The enum type to return

GetEnum<E>(String)

Get a field from an int16-compatible database value and parse it as the given enum

Declaration
public E GetEnum<E>(string name)
Parameters
Type Name Description
String name

Field specification

Returns
Type Description
E

Enum value, or default(E) if sentry blocks reading

Type Parameters
Name Description
E

The enum type to return

GetFieldInfo(Int32)

Obtain the FieldInfo used from the given Index.

Declaration
public FieldInfo GetFieldInfo(int i)
Parameters
Type Name Description
Int32 i
Returns
Type Description
FieldInfo

Field info from the given index. Null is returned if there is no valid FieldInfo at the given index.

GetFieldInfo(String)

Obtain the FieldInfo used at the field with the given name.

Declaration
public FieldInfo GetFieldInfo(string name)
Parameters
Type Name Description
String name

Name, or alias, of the returned field.

Returns
Type Description
FieldInfo

Field info for the given name. Null is returned if there is no valid FieldInfo for the field name.

GetFieldProperty(FieldInfo)

Declaration
public FieldProperty GetFieldProperty(FieldInfo field)
Parameters
Type Name Description
FieldInfo field
Returns
Type Description
FieldProperty

GetFieldProperty(Int32)

Declaration
public FieldProperty GetFieldProperty(int i)
Parameters
Type Name Description
Int32 i
Returns
Type Description
FieldProperty

GetFieldProperty(String)

Declaration
public FieldProperty GetFieldProperty(string name)
Parameters
Type Name Description
String name
Returns
Type Description
FieldProperty

GetFieldType(Int32)

Return the actual Type class for the data type

Declaration
public Type GetFieldType(int i)
Parameters
Type Name Description
Int32 i

0-based index.

Returns
Type Description
Type

The Type information corresponding to the type of Object that would be returned from GetValue(Int32).

Exceptions
Type Condition
IndexOutOfRangeException

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

GetFieldValue(FieldInfo)

Returns the current value of a field -- used by the sentry mechanism to determine what you are allowed to see or change. Returns null if the reader is closed.

Declaration
public object GetFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

The field we want to know about

Returns
Type Description
Object

Null if the reader is closed, or if the current row does not match the rowid parameter.

GetFloat(FieldInfo)

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

Declaration
public float GetFloat(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Single
Remarks

Returns NaN if the column is hidden by a sentry

GetFloat(Int32)

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

Declaration
public float GetFloat(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Single
Remarks

Returns NaN if the column is hidden by a sentry

GetFloat(String)

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

Declaration
public float GetFloat(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Single
Remarks

Returns NaN if the column is hidden by a sentry

GetGuid(FieldInfo)

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

Declaration
public Guid GetGuid(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Guid
Remarks

Returns Guid.Empty if the column is hidden by a sentry

GetGuid(Int32)

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

Declaration
public Guid GetGuid(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Guid
Remarks

Returns Guid.Empty if the column is hidden by a sentry

GetGuid(String)

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

Declaration
public Guid GetGuid(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Guid
Remarks

Returns Guid.Empty if the column is hidden by a sentry

GetIndexOfField(FieldInfo)

Return the 0-based position of a given position. Returns -1 if the field is not found in the list of columns in the result set. If no field matches exactly (i.e. same object), then it returns the first matching field.

Declaration
public int GetIndexOfField(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Field to find

Returns
Type Description
Int32

0-based index of field position

Remarks

The use of IsSameField is what distinguishes this from GetOrdinal. This function is looser than GetOrdinal. It is used inside the sentry logic which may not have access to the original column definitions.

GetInt16(FieldInfo)

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

Declaration
public short GetInt16(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Int16
Remarks

Returns 0 if the column is hidden by a sentry

GetInt16(Int32)

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

Declaration
public short GetInt16(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Int16
Remarks

Returns 0 if the column is hidden by a sentry

GetInt16(String)

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

Declaration
public short GetInt16(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Int16
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32(FieldInfo)

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

Declaration
public int GetInt32(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Int32
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32(Int32)

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

Declaration
public int GetInt32(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Int32
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32(String)

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

Declaration
public int GetInt32(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Int32
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32Array(FieldInfo)

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

Declaration
public int[] GetInt32Array(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Int32[]
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32Array(Int32)

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

Declaration
public int[] GetInt32Array(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Int32[]
Remarks

Returns 0 if the column is hidden by a sentry

GetInt32Array(String)

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

Declaration
public int[] GetInt32Array(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Int32[]
Remarks

Returns 0 if the column is hidden by a sentry

GetInt64(FieldInfo)

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

Declaration
public long GetInt64(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
Int64
Remarks

Returns 0 if the column is hidden by a sentry

GetInt64(Int32)

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

Declaration
public long GetInt64(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
Int64
Remarks

Returns 0 if the column is hidden by a sentry

GetInt64(String)

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

Declaration
public long GetInt64(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Int64
Remarks

Returns 0 if the column is hidden by a sentry

GetKnownFields()

Declaration
public List<FieldInfo> GetKnownFields()
Returns
Type Description
List<FieldInfo>

GetName(Int32)

Return the name of the i'th column.

Declaration
public string GetName(int i)
Parameters
Type Name Description
Int32 i

0 based index.

Returns
Type Description
String

The name of the column. Usually the same as the database column name, but it depends on what you aliased the column as in your select statement

Exceptions
Type Condition
IndexOutOfRangeException

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

GetOrdinal(FieldInfo)

Return the index of the field represented by the field info, or -1; no exceptions thrown

Declaration
public int GetOrdinal(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Information about the field.

Returns
Type Description
Int32

Ordinal of the field. First field is ordinal 0. Returns -1 if the field is not found.

GetOrdinal(String)

Return the index of the named field, or -1; no exceptions thrown

Declaration
public int GetOrdinal(string name)
Parameters
Type Name Description
String name

The name of the field

Returns
Type Description
Int32

A zero-based index suitable for use with GetValue(int) and the rest of the Get functions.

GetPersistedFieldValue(FieldInfo)

You allways select the persisted value

Declaration
public object GetPersistedFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

The field we want to know about

Returns
Type Description
Object

Null if the reader is closed, or if the current row does not match the rowid parameter.

GetRelations(TableInfo, SoTable)

Declaration
public RelationInfo[] GetRelations(TableInfo mainTable, SoTable relatedTable)
Parameters
Type Name Description
TableInfo mainTable
SoTable relatedTable
Returns
Type Description
RelationInfo[]

GetSchemaTable()

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

Declaration
public DataTable GetSchemaTable()
Returns
Type Description
DataTable

A DataTable that describes the column metadata.

Exceptions
Type Condition
InvalidOperationException

The IDataReader is closed.

GetString(FieldInfo)

Gets the value of the specified column as a string.

Declaration
public string GetString(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column identifier

Returns
Type Description
String
Remarks

Returns "" if the column is hidden by a sentry

GetString(Int32)

Gets the value of the specified column as a string.

Declaration
public string GetString(int i)
Parameters
Type Name Description
Int32 i

Column index

Returns
Type Description
String
Remarks

Returns "" if the column is hidden by a sentry

GetString(String)

Gets the value of the specified column as a string.

Declaration
public string GetString(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
String
Remarks

Returns "" if the column is hidden by a sentry

GetValue(FieldInfo)

Return the value of the datatype.

Declaration
public object GetValue(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Field info object identifying the desired field

Returns
Type Description
Object

A generic object. What it is depends on the type of the column. Could be an int. Could be a string. You won't know until you check GetDataTypeName

GetValue(FieldInfo, out FieldProperty)

Declaration
public object GetValue(FieldInfo field, out FieldProperty fieldProperty)
Parameters
Type Name Description
FieldInfo field
FieldProperty fieldProperty
Returns
Type Description
Object

GetValue(Int32)

Return the value of the datatype.

Declaration
public object GetValue(int i)
Parameters
Type Name Description
Int32 i

0-based index

Returns
Type Description
Object

A generic object. What it is depends on the type of the column. Could be an int. Could be a string. You won't know until you check GetDataTypeName

GetValue(Int32, out FieldProperty)

Declaration
public object GetValue(int i, out FieldProperty fieldProperty)
Parameters
Type Name Description
Int32 i
FieldProperty fieldProperty
Returns
Type Description
Object

GetValue(String)

Return the value of the datatype.

Declaration
public object GetValue(string name)
Parameters
Type Name Description
String name

Column name; if more than one column has this name, the first matching one is used

Returns
Type Description
Object

A generic object. What it is depends on the type of the column. Could be an int. Could be a string. You won't know until you check GetDataTypeName

GetValue(String, out FieldProperty)

Declaration
public object GetValue(string name, out FieldProperty fieldProperty)
Parameters
Type Name Description
String name
FieldProperty fieldProperty
Returns
Type Description
Object

GetValues(Object[])

Copy all the values of the current row into the values parameter.

Declaration
public int GetValues(object[] values)
Parameters
Type Name Description
Object[] values

Array of objects that is filled with the values in the current row.

Returns
Type Description
Int32

The number of columns copied

Remarks

Fields hidden by sentry are nulled out in the values array.

IsDBNull(FieldInfo)

Returns TRUE if the database column contains a NULL value (i.e not 0 or empty string, but no value at all). NULL values are not convertible to any value. Attempting to read a NULL as an integer or string will trigger an exception.

Declaration
public bool IsDBNull(FieldInfo fieldInfo)
Parameters
Type Name Description
FieldInfo fieldInfo

Column definition

Returns
Type Description
Boolean

true if the specified field info is DB null, otherwise, false.

Remarks

Returns TRUE if the column is hidden by a sentry.

IsDBNull(Int32)

Returns TRUE if the database column contains a NULL value (i.e not 0 or empty string, but no value at all). NULL values are not convertible to any value. Attempting to read a NULL as an integer or string will trigger an exception.

Declaration
public bool IsDBNull(int i)
Parameters
Type Name Description
Int32 i

0-based column index.

Returns
Type Description
Boolean

true if the specified field is set to null. Otherwise, false.

Remarks

Returns TRUE if the column is hidden by a sentry.

IsDBNull(String)

Returns TRUE if the database column contains a NULL value (i.e not 0 or empty string, but no value at all). NULL values are not convertible to any value. Attempting to read a NULL as an integer or string will trigger an exception.

Declaration
public bool IsDBNull(string name)
Parameters
Type Name Description
String name

Column name

Returns
Type Description
Boolean

true if the specified name is DB null, otherwise, false.

Remarks

Returns TRUE if the column is hidden by a sentry.

IsGhostField(FieldInfo)

Check if there is actually a valid value for the given field. If not, then this field is called a 'ghost'. This happens if a field is part of an outer join that missed, or null for some other reason.

Declaration
public bool IsGhostField(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Boolean

True if the field is a 'ghost', i.e., if it has NO valid known value. true is also returned for nonexistent fields.

IsPersistedFieldValueKnown(FieldInfo)

You allways select the persisted value.

Declaration
public bool IsPersistedFieldValueKnown(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

The field we want to know about

Returns
Type Description
Boolean

Returns true if the field is in the result set.

NextResult()

Advances the data reader to the next result, when reading the results of batch SQL statements.

Declaration
public bool NextResult()
Returns
Type Description
Boolean

true if there are more rows; otherwise, false.

Read()

Reads the first/next row of data into the reader, discarding the previous row. The values are accessible through the GetXxx methods on the reader object.

If the Select query has specified a nonzero DbRowsToSkip, this skipping will either be done by database (but so far only Sybase 9 has support for that), or done in a tight loop here.

Declaration
public bool Read()
Returns
Type Description
Boolean

True if the read succeeded. If there is no more data, returns false

SetPreAcceptDelegate(Func<SoDataReader, Boolean>)

Set a callback method, that will be called BEFORE sentry calculations are performed for a row. If the callback returns false, the row is skipped and does not count towards the row total

Declaration
public void SetPreAcceptDelegate(Func<SoDataReader, bool> preAcceptCallback)
Parameters
Type Name Description
Func<SoDataReader, Boolean> preAcceptCallback

ToString()

Override: Return the current row of the inner reader for debugging purposes

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

TryGetValue(FieldInfo, ref Boolean)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref bool value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

Boolean value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

Remarks

As boolean fields are not supported in the database, it is assumed that the value requested is a numerical value and true will be assigned to value if the database value is greater than 0.

TryGetValue(FieldInfo, ref DateTime)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref DateTime value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

DateTime value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

TryGetValue(FieldInfo, ref Double)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref double value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

Double value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

TryGetValue(FieldInfo, ref Int16)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref short value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

Int16 value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

TryGetValue(FieldInfo, ref Int32)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref int value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

Int32 value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

TryGetValue(FieldInfo, ref String)

Assign the value if it is not null and sentry permits it.

Declaration
public bool TryGetValue(FieldInfo field, ref string value)
Parameters
Type Name Description
FieldInfo field

Returned field from the database.

String value

Value to be assigned.

Returns
Type Description
Boolean

True if the value is assigned.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
IEnumerator

Implements

System.Data.IDataReader
System.IDisposable
System.Data.IDataRecord
ISoDataLookup
ISentryIgnorable
System.Collections.IEnumerable
ISoDataRecord

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top