Class SoDataReader
Implements the IDataReader interface.
Implements
Inherited Members
Namespace: SuperOfficeData
Assembly: SoDataBase.dll
Syntax
public sealed class SoDataReader : MarshalByRefObject, IDataReader, IDataRecord, IDisposable, 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 |
|---|---|
| int | rows read. |
Depth
Gets a value indicating the depth of nesting for the current row.
Declaration
public int Depth { get; }
Property Value
| Type | Description |
|---|---|
| int |
FieldCount
Gets the number of columns in the current row.
Declaration
public int FieldCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
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 |
|---|---|
| bool |
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 |
|---|---|
| bool |
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 |
|---|---|
| bool |
this[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 |
this[int]
Return value at column position. First column = 0.
Declaration
public object this[int i] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | i |
Property Value
| Type | Description |
|---|---|
| object |
Remarks
If the column is hidden by a sentry then null is returned instead of the value.
this[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 |
|---|---|
| int |
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 |
|---|---|
| bool | Boolean value |
Remarks
Returns false if the column is hidden by a sentry
GetBoolean(int)
Gets the value of the specified column as a bool.
Declaration
public bool GetBoolean(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | column index |
Returns
| Type | Description |
|---|---|
| bool |
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 |
|---|---|
| bool | 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(int)
Gets the value of the specified column as a byte.
Declaration
public byte GetByte(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int, long, byte[], int, int)
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 |
|---|---|---|
| int | i | Column index |
| long | fieldOffset | |
| byte | buffer | |
| int | bufferoffset | |
| int | length |
Returns
| Type | Description |
|---|---|
| long |
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(int)
Gets the value of the specified column as a single character.
Declaration
public char GetChar(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int, long, char[], int, int)
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 |
|---|---|---|
| int | i | Column index |
| long | fieldoffset | |
| char | buffer | |
| int | bufferoffset | |
| int | length |
Returns
| Type | Description |
|---|---|
| long |
Remarks
Returns 0 if the column is hidden by a sentry
GetData(int)
Returns a reader to the given column - usually used to access nested tables.
Declaration
public IDataReader GetData(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| IDataReader |
Remarks
Returns null if the column is hidden by a sentry
GetDataTypeName(int)
Return the name of the datatype of the i'th column
Declaration
public string GetDataTypeName(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Gets the value of the specified column as a DateTime.
Declaration
public DateTime GetDateTime(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Gets the value of the specified column as a decimal.
Declaration
public decimal GetDecimal(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Gets the value of the specified column as a double-precision floating point number.
Declaration
public double GetDouble(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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>(int)
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 |
|---|---|---|
| int | 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(int)
Obtain the FieldInfo used from the given Index.
Declaration
public FieldInfo GetFieldInfo(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Declaration
public FieldProperty GetFieldProperty(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i |
Returns
| Type | Description |
|---|---|
| FieldProperty |
GetFieldProperty(string)
Declaration
public FieldProperty GetFieldProperty(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| FieldProperty |
GetFieldType(int)
Return the actual Type class for the data type
Declaration
public Type GetFieldType(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | 0-based index. |
Returns
| Type | Description |
|---|---|
| Type | The Type information corresponding to the type of object that would be returned from GetValue(int). |
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 |
|---|---|
| float |
Remarks
Returns NaN if the column is hidden by a sentry
GetFloat(int)
Gets the value of the specified column as a single-precision floating point number.
Declaration
public float GetFloat(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| float |
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 |
|---|---|
| float |
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(int)
Gets the value of the specified column as a globally-unique identifier (GUID).
Declaration
public Guid GetGuid(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
|---|---|
| int | 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 |
|---|---|
| short |
Remarks
Returns 0 if the column is hidden by a sentry
GetInt16(int)
Gets the value of the specified column as a 16-bit signed integer.
Declaration
public short GetInt16(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| short |
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 |
|---|---|
| short |
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 |
|---|---|
| int |
Remarks
Returns 0 if the column is hidden by a sentry
GetInt32(int)
Gets the value of the specified column as a 32-bit signed integer.
Declaration
public int GetInt32(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| int |
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 |
|---|---|
| int |
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 |
|---|---|
| int |
Remarks
Returns 0 if the column is hidden by a sentry
GetInt32Array(int)
Gets the value of the specified column as a 32-bit signed integer.
Declaration
public int[] GetInt32Array(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| int |
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 |
|---|---|
| int |
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 |
|---|---|
| long |
Remarks
Returns 0 if the column is hidden by a sentry
GetInt64(int)
Gets the value of the specified column as a 64-bit signed integer.
Declaration
public long GetInt64(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | Column index |
Returns
| Type | Description |
|---|---|
| long |
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 |
|---|---|
| long |
Remarks
Returns 0 if the column is hidden by a sentry
GetKnownFields()
Calculating rights for all tables and field potentially covered by a Sentry can be a huge waste. This method should return only-and-all FieldInfos actually present in the data object, so the Sentry can avoid calculating stuff that isn't needed
Declaration
public List<FieldInfo> GetKnownFields()
Returns
| Type | Description |
|---|---|
| ListFieldInfo |
GetName(int)
Return the name of the i'th column.
Declaration
public string GetName(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
|---|---|
| int | 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 |
|---|---|
| int | 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(int)
Gets the value of the specified column as a string.
Declaration
public string GetString(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int)
Return the value of the datatype.
Declaration
public object GetValue(int i)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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(int, out FieldProperty)
Declaration
public object GetValue(int i, out FieldProperty fieldProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
|---|---|
| int | 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 |
|---|---|
| bool |
|
Remarks
Returns TRUE if the column is hidden by a sentry.
IsDBNull(int)
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 |
|---|---|---|
| int | i | 0-based column index. |
Returns
| Type | Description |
|---|---|
| bool | 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 |
|---|---|
| bool |
|
Remarks
Returns TRUE if the column is hidden by a sentry.
IsDBNullAsync(FieldInfo, CancellationToken)
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
[CreateSyncVersion(OmitNullableDirective = true)]
public Task<bool> IsDBNullAsync(FieldInfo fieldInfo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | fieldInfo | Column definition |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool |
|
Remarks
Returns TRUE if the column is hidden by a sentry.
IsDBNullAsync(int, CancellationToken)
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
[CreateSyncVersion(OmitNullableDirective = true)]
public Task<bool> IsDBNullAsync(int i, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | i | 0-based column index. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool | true if the specified field is set to null. Otherwise, false. |
Remarks
Returns TRUE if the column is hidden by a sentry.
IsDBNullAsync(string, CancellationToken)
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
[CreateSyncVersion(OmitNullableDirective = true)]
public Task<bool> IsDBNullAsync(string name, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Column name |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool |
|
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 |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | true if there are more rows; otherwise, false. |
NextResultAsync(CancellationToken)
Advances the data reader to the next result, when reading the results of batch SQL statements.
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public Task<bool> NextResultAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool | 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 |
|---|---|
| bool | True if the read succeeded. If there is no more data, returns false |
ReadAsync(CancellationToken)
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
[CreateSyncVersion(OmitNullableDirective = true)]
public Task<bool> ReadAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool | True if the read succeeded. If there is no more data, returns false |
SetPreAcceptDelegate(Func<SoDataReader, bool>)
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 |
|---|---|---|
| FuncSoDataReaderbool | preAcceptCallback |
ToString()
Override: Return the current row of the inner reader for debugging purposes
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
TryGetValue(FieldInfo, ref bool)
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. |
| bool | value | Value to be assigned. |
Returns
| Type | Description |
|---|---|
| bool | 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 |
|---|---|
| bool | 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 |
|---|---|
| bool | True if the value is assigned. |
TryGetValue(FieldInfo, ref short)
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. |
| short | value | Value to be assigned. |
Returns
| Type | Description |
|---|---|
| bool | True if the value is assigned. |
TryGetValue(FieldInfo, ref int)
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. |
| int | value | Value to be assigned. |
Returns
| Type | Description |
|---|---|
| bool | 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 |
|---|---|
| bool | True if the value is assigned. |