Table of Contents

Class DataRowViewExtensions

Namespace
Tripous.Data
Assembly
Tripous.Data.dll

A helper class for returning typed values from a DataRowView in a safe manner, by leveraging the existing DataRowExtensions.

public static class DataRowViewExtensions
Inheritance
DataRowViewExtensions
Inherited Members

Methods

AsBoolean(DataRowView, int)

Returns the value of the column at the specified index as a bool, or false if the value is null or DBNull.

public static bool AsBoolean(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

bool

AsBoolean(DataRowView, int, bool)

Returns the value of the column at the specified index as a bool, or Default if the value is null or DBNull.

public static bool AsBoolean(this DataRowView drv, int ColumnIndex, bool Default)

Parameters

drv DataRowView
ColumnIndex int
Default bool

Returns

bool

AsBoolean(DataRowView, string)

Returns the value of the specified column as a bool, or false if the value is null or DBNull.

public static bool AsBoolean(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

bool

AsBoolean(DataRowView, string, bool)

Returns the value of the specified column as a bool, or Default if the value is null or DBNull.

public static bool AsBoolean(this DataRowView drv, string ColumnName, bool Default)

Parameters

drv DataRowView
ColumnName string
Default bool

Returns

bool

AsDateTime(DataRowView, int)

Returns the value of the column at the specified index as a DateTime, or MinValue if the value is null or DBNull.

public static DateTime AsDateTime(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

DateTime

AsDateTime(DataRowView, int, DateTime)

Returns the value of the column at the specified index as a DateTime, or Default if the value is null or DBNull.

public static DateTime AsDateTime(this DataRowView drv, int ColumnIndex, DateTime Default)

Parameters

drv DataRowView
ColumnIndex int
Default DateTime

Returns

DateTime

AsDateTime(DataRowView, string)

Returns the value of the specified column as a DateTime, or MinValue if the value is null or DBNull.

public static DateTime AsDateTime(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

DateTime

AsDateTime(DataRowView, string, DateTime)

Returns the value of the specified column as a DateTime, or Default if the value is null or DBNull.

public static DateTime AsDateTime(this DataRowView drv, string ColumnName, DateTime Default)

Parameters

drv DataRowView
ColumnName string
Default DateTime

Returns

DateTime

AsDecimal(DataRowView, int)

Returns the value of the column at the specified index as a decimal, or zero if the value is null or DBNull.

public static decimal AsDecimal(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

decimal

AsDecimal(DataRowView, int, decimal)

Returns the value of the column at the specified index as a decimal, or Default if the value is null or DBNull.

public static decimal AsDecimal(this DataRowView drv, int ColumnIndex, decimal Default)

Parameters

drv DataRowView
ColumnIndex int
Default decimal

Returns

decimal

AsDecimal(DataRowView, string)

Returns the value of the specified column as a decimal, or zero if the value is null or DBNull.

public static decimal AsDecimal(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

decimal

AsDecimal(DataRowView, string, decimal)

Returns the value of the specified column as a decimal, or Default if the value is null or DBNull.

public static decimal AsDecimal(this DataRowView drv, string ColumnName, decimal Default)

Parameters

drv DataRowView
ColumnName string
Default decimal

Returns

decimal

AsDouble(DataRowView, int)

Returns the value of the column at the specified index as a double, or zero if the value is null or DBNull.

public static double AsDouble(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

double

AsDouble(DataRowView, int, double)

Returns the value of the column at the specified index as a double, or Default if the value is null or DBNull.

public static double AsDouble(this DataRowView drv, int ColumnIndex, double Default)

Parameters

drv DataRowView
ColumnIndex int
Default double

Returns

double

AsDouble(DataRowView, string)

Returns the value of the specified column as a double, or zero if the value is null or DBNull.

public static double AsDouble(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

double

AsDouble(DataRowView, string, double)

Returns the value of the specified column as a double, or Default if the value is null or DBNull.

public static double AsDouble(this DataRowView drv, string ColumnName, double Default)

Parameters

drv DataRowView
ColumnName string
Default double

Returns

double

AsInteger(DataRowView, int)

Returns the value of the column at the specified index as an int, or zero if the value is null or DBNull.

public static int AsInteger(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

int

AsInteger(DataRowView, int, int)

Returns the value of the column at the specified index as an int, or Default if the value is null or DBNull.

public static int AsInteger(this DataRowView drv, int ColumnIndex, int Default)

Parameters

drv DataRowView
ColumnIndex int
Default int

Returns

int

AsInteger(DataRowView, string)

Returns the value of the specified column as an int, or zero if the value is null or DBNull.

public static int AsInteger(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

int

AsInteger(DataRowView, string, int)

Returns the value of the specified column as an int, or Default if the value is null or DBNull.

public static int AsInteger(this DataRowView drv, string ColumnName, int Default)

Parameters

drv DataRowView
ColumnName string
Default int

Returns

int

AsObject(DataRowView, int, object)

Returns the value of the column at the specified index as an object, or Default if the value is null or DBNull.

public static object AsObject(this DataRowView drv, int ColumnIndex, object Default)

Parameters

drv DataRowView
ColumnIndex int
Default object

Returns

object

AsObject(DataRowView, string, object)

Returns the value of the specified column as an object, or Default if the value is null or DBNull.

public static object AsObject(this DataRowView drv, string ColumnName, object Default)

Parameters

drv DataRowView
ColumnName string
Default object

Returns

object

AsString(DataRowView, int)

Returns the value of the column at the specified index as a string, or an empty string if the value is null or DBNull.

public static string AsString(this DataRowView drv, int ColumnIndex)

Parameters

drv DataRowView
ColumnIndex int

Returns

string

AsString(DataRowView, int, string)

Returns the value of the column at the specified index as a string, or Default if the value is null or DBNull.

public static string AsString(this DataRowView drv, int ColumnIndex, string Default)

Parameters

drv DataRowView
ColumnIndex int
Default string

Returns

string

AsString(DataRowView, string)

Returns the value of the specified column as a string, or an empty string if the value is null or DBNull.

public static string AsString(this DataRowView drv, string ColumnName)

Parameters

drv DataRowView
ColumnName string

Returns

string

AsString(DataRowView, string, string)

Returns the value of the specified column as a string, or Default if the value is null or DBNull.

public static string AsString(this DataRowView drv, string ColumnName, string Default)

Parameters

drv DataRowView
ColumnName string
Default string

Returns

string

BlobToStream(DataRowView, string)

Returns the contents of the specified blob field as a new MemoryStream.

public static MemoryStream BlobToStream(this DataRowView drv, string FieldName)

Parameters

drv DataRowView
FieldName string

Returns

MemoryStream

BlobToStream(DataRowView, string, Stream)

Writes the contents of the specified blob field to Stream.

public static void BlobToStream(this DataRowView drv, string FieldName, Stream Stream)

Parameters

drv DataRowView
FieldName string
Stream Stream

BlobToString(DataRowView, string)

Returns the contents of the specified blob field as a string.

public static string BlobToString(this DataRowView drv, string BlobFieldName)

Parameters

drv DataRowView
BlobFieldName string

Returns

string

CopyTo(DataRowView, DataRowView)

Copies the values of Source to Dest.

public static void CopyTo(this DataRowView Source, DataRowView Dest)

Parameters

Source DataRowView
Dest DataRowView

LoadFromStream(DataRowView, string, Stream)

Reads the contents of Stream and stores them in the specified blob field.

public static void LoadFromStream(this DataRowView drv, string BlobFieldName, Stream Stream)

Parameters

drv DataRowView
BlobFieldName string
Stream Stream

SafeCopyTo(DataRowView, DataRowView)

Safely copies the values of Source to Dest, copying only columns that exist in both rows.

public static void SafeCopyTo(this DataRowView Source, DataRowView Dest)

Parameters

Source DataRowView
Dest DataRowView

SaveToStream(DataRowView, string, Stream)

Writes the contents of the specified blob field to Stream.

public static void SaveToStream(this DataRowView drv, string BlobFieldName, Stream Stream)

Parameters

drv DataRowView
BlobFieldName string
Stream Stream

StreamToBlob(DataRowView, string, Stream)

Reads the contents of Stream and stores them in the specified blob field.

public static void StreamToBlob(this DataRowView drv, string FieldName, Stream Stream)

Parameters

drv DataRowView
FieldName string
Stream Stream

StringToBlob(DataRowView, string, string)

Converts Value to bytes and stores it in the specified blob field.

public static void StringToBlob(this DataRowView drv, string BlobFieldName, string Value)

Parameters

drv DataRowView
BlobFieldName string
Value string

TryGetValue(DataRowView, string, out object)

Returns true and sets Value to the value of the specified field, if the field exists; otherwise returns false.

public static bool TryGetValue(this DataRowView drv, string FieldName, out object Value)

Parameters

drv DataRowView
FieldName string
Value object

Returns

bool