Class DataRowExtensions
A helper class for returning typed values from a DataRow in a safe manner
public static class DataRowExtensions
- Inheritance
-
DataRowExtensions
- Inherited Members
Methods
AppendTo(DataRow, DataTable)
Copies, using a safe copy, and appends Source DataRow to DestTable
public static DataRow AppendTo(this DataRow Source, DataTable DestTable)
Parameters
Returns
AsBoolean(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static bool AsBoolean(this DataRow row, int ColumnIndex)
Parameters
Returns
AsBoolean(DataRow, int, bool)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static bool AsBoolean(this DataRow row, int ColumnIndex, bool Default)
Parameters
Returns
AsBoolean(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static bool AsBoolean(this DataRow row, string ColumnName)
Parameters
Returns
AsBoolean(DataRow, string, bool)
Returns the value of the field by ColumnName of row, if any, else Default.
public static bool AsBoolean(this DataRow row, string ColumnName, bool Default)
Parameters
Returns
AsDateTime(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static DateTime AsDateTime(this DataRow row, int ColumnIndex)
Parameters
Returns
AsDateTime(DataRow, int, DateTime)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static DateTime AsDateTime(this DataRow row, int ColumnIndex, DateTime Default)
Parameters
Returns
AsDateTime(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static DateTime AsDateTime(this DataRow row, string ColumnName)
Parameters
Returns
AsDateTime(DataRow, string, DateTime)
Returns the value of the field by ColumnName of row, if any, else Default.
public static DateTime AsDateTime(this DataRow row, string ColumnName, DateTime Default)
Parameters
Returns
AsDecimal(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static decimal AsDecimal(this DataRow row, int ColumnIndex)
Parameters
Returns
AsDecimal(DataRow, int, decimal)
Returns the value of the field by ColumnName of row, if any, else Default.
public static decimal AsDecimal(this DataRow row, int ColumnIndex, decimal Default)
Parameters
Returns
AsDecimal(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static decimal AsDecimal(this DataRow row, string ColumnName)
Parameters
Returns
AsDecimal(DataRow, string, decimal)
Returns the value of the field by ColumnName of row, if any, else Default.
public static decimal AsDecimal(this DataRow row, string ColumnName, decimal Default)
Parameters
Returns
AsDouble(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static double AsDouble(this DataRow row, int ColumnIndex)
Parameters
Returns
AsDouble(DataRow, int, double)
Returns the value of the field by ColumnName of row, if any, else Default.
public static double AsDouble(this DataRow row, int ColumnIndex, double Default)
Parameters
Returns
AsDouble(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static double AsDouble(this DataRow row, string ColumnName)
Parameters
Returns
AsDouble(DataRow, string, double)
Returns the value of the field by ColumnName of row, if any, else Default.
public static double AsDouble(this DataRow row, string ColumnName, double Default)
Parameters
Returns
AsInteger(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static int AsInteger(this DataRow row, int ColumnIndex)
Parameters
Returns
AsInteger(DataRow, int, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static int AsInteger(this DataRow row, int ColumnIndex, int Default)
Parameters
Returns
AsInteger(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static int AsInteger(this DataRow row, string ColumnName)
Parameters
Returns
AsInteger(DataRow, string, int)
Returns the value of the field by ColumnName of row, if any, else Default.
public static int AsInteger(this DataRow row, string ColumnName, int Default)
Parameters
Returns
AsObject(DataRow, int, object)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static object AsObject(this DataRow row, int ColumnIndex, object Default)
Parameters
Returns
AsObject(DataRow, string, object)
Returns the value of the field by ColumnName of row, if any, else Default.
public static object AsObject(this DataRow row, string ColumnName, object Default)
Parameters
Returns
AsString(DataRow, int)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static string AsString(this DataRow row, int ColumnIndex)
Parameters
Returns
AsString(DataRow, int, string)
Returns the value of the field by ColumnIndex of row, if any, else Default.
public static string AsString(this DataRow row, int ColumnIndex, string Default)
Parameters
Returns
AsString(DataRow, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static string AsString(this DataRow row, string ColumnName)
Parameters
Returns
AsString(DataRow, string, string)
Returns the value of the field by ColumnName of row, if any, else Default.
public static string AsString(this DataRow row, string ColumnName, string Default)
Parameters
Returns
BlobToStream(DataRow, string)
If the specified FieldName field is of type byte[] or object, then it returns the field contents as a MemoryStream.
public static MemoryStream BlobToStream(this DataRow Row, string FieldName)
Parameters
Returns
BlobToStream(DataRow, string, Stream)
Saves FieldName field of Row, if field is of type byte[] or object, to Stream
public static void BlobToStream(this DataRow Row, string FieldName, Stream Stream)
Parameters
BlobToString(DataRow, string)
Reads and returns a string value stored in the BlobFieldName blob field of the specified Row
public static string BlobToString(this DataRow Row, string BlobFieldName)
Parameters
Returns
CopyTo(DataRow, DataRow)
Copies Source to Dest.
WARNING: Assumes that Source and Dest are identical in schema.
WARNING: Dest columns that do not exist in Source remain untouched.
public static void CopyTo(this DataRow Source, DataRow Dest)
Parameters
GetDataRowView(DataRow, DataView)
Returns the DataRowView of the specified DataRow.
public static DataRowView GetDataRowView(this DataRow Row, DataView DataView)
Parameters
Returns
LoadFromStream(DataRow, string, Stream)
Loads FieldName field of Row, if field is of type byte[] or object using the content of Stream
public static void LoadFromStream(this DataRow Row, string BlobFieldName, Stream Stream)
Parameters
SafeCopyTo(DataRow, DataRow)
Copies Source to Dest.
WARNING: Only data from columns with identical names to both DataRows are copied.
WARNING: Dest columns that do not exist in Source remain untouched.
public static void SafeCopyTo(this DataRow Source, DataRow Dest)
Parameters
SaveToStream(DataRow, string, Stream)
Saves FieldName field of Row, if field is of type byte[] or object, to Stream
public static void SaveToStream(this DataRow Row, string BlobFieldName, Stream Stream)
Parameters
SetValue(DataRow, string, object)
Sets a value to the specified field of the specified row in a safe manner, i.e. only if the field exists.
public static bool SetValue(this DataRow Row, string FieldName, object Value)
Parameters
Returns
StreamToBlob(DataRow, string, Stream)
Loads FielName field of Row, if field is of type byte[] or object using the content of Stream
public static void StreamToBlob(this DataRow Row, string FieldName, Stream Stream)
Parameters
StringToBlob(DataRow, string, string)
Writes Value to the BlobFieldName blob field of the specified Row
public static void StringToBlob(this DataRow Row, string BlobFieldName, string Value)
Parameters
TryGetValue(DataRow, string, out object)
Returns the value of a column specified by name and true on success.
public static bool TryGetValue(this DataRow Row, string FieldName, out object Value)