C# Class GSF.Data.DataRowExtensions

Static extension methods for DataRow that will automatically type cast fields to the desired value. This is superior to DataSetExtensions.dll because if the field type does not exactly match in that case, a cast exception occurs.
Show file Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
AsBoolean ( this row, int ordinal, bool valueIfNull ) : bool

Attempts to type cast the specified column of a to the defined type.

AsBoolean ( this row, string columnName, bool valueIfNull ) : bool

Attempts to type cast the specified column of a to the defined type.

AsBoolean ( this row, int ordinal ) : bool?

Attempts to type cast the specified column of a to the defined type.

AsBoolean ( this row, string columnName ) : bool?

Attempts to type cast the specified column of a to the defined type.

AsByte ( this row, int ordinal, byte valueIfNull ) : byte

Attempts to type cast the specified column of a to the defined type.

AsByte ( this row, string columnName, byte valueIfNull ) : byte

Attempts to type cast the specified column of a to the defined type.

AsByte ( this row, int ordinal ) : byte?

Attempts to type cast the specified column of a to the defined type.

AsByte ( this row, string columnName ) : byte?

Attempts to type cast the specified column of a to the defined type.

AsByteArray ( this row, int ordinal ) : byte[]

Attempts to type cast the specified column of a to the defined type.

AsByteArray ( this row, int ordinal, byte valueIfNull ) : byte[]

Attempts to type cast the specified column of a to the defined type.

AsByteArray ( this row, string columnName ) : byte[]

Attempts to type cast the specified column of a to the defined type.

AsByteArray ( this row, string columnName, byte valueIfNull ) : byte[]

Attempts to type cast the specified column of a to the defined type.

AsDateTime ( this row, int ordinal, System.DateTime valueIfNull ) : System.DateTime

Attempts to type cast the specified column of a to the defined type.

AsDateTime ( this row, string columnName, System.DateTime valueIfNull ) : System.DateTime

Attempts to type cast the specified column of a to the defined type.

AsDateTime ( this row, int ordinal ) : DateTime?

Attempts to type cast the specified column of a to the defined type.

AsDateTime ( this row, string columnName ) : DateTime?

Attempts to type cast the specified column of a to the defined type.

AsDecimal ( this row, int ordinal, decimal valueIfNull ) : decimal

Attempts to type cast the specified column of a to the defined type.

AsDecimal ( this row, string columnName, decimal valueIfNull ) : decimal

Attempts to type cast the specified column of a to the defined type.

AsDecimal ( this row, int ordinal ) : decimal?

Attempts to type cast the specified column of a to the defined type.

AsDecimal ( this row, string columnName ) : decimal?

Attempts to type cast the specified column of a to the defined type.

AsDouble ( this row, int ordinal, double valueIfNull ) : double

Attempts to type cast the specified column of a to the defined type.

AsDouble ( this row, string columnName, double valueIfNull ) : double

Attempts to type cast the specified column of a to the defined type.

AsDouble ( this row, int ordinal ) : double?

Attempts to type cast the specified column of a to the defined type.

AsDouble ( this row, string columnName ) : double?

Attempts to type cast the specified column of a to the defined type.

AsGuid ( this row, int ordinal, System.Guid valueIfNull ) : System.Guid

Attempts to type cast the specified column of a to the defined type.

AsGuid ( this row, string columnName, System.Guid valueIfNull ) : System.Guid

Attempts to type cast the specified column of a to the defined type.

AsGuid ( this row, int ordinal ) : Guid?

Attempts to type cast the specified column of a to the defined type.

AsGuid ( this row, string columnName ) : Guid?

Attempts to type cast the specified column of a to the defined type.

AsInt16 ( this row, int ordinal, short valueIfNull ) : short

Attempts to type cast the specified column of a to the defined type.

AsInt16 ( this row, string columnName, short valueIfNull ) : short

Attempts to type cast the specified column of a to the defined type.

AsInt16 ( this row, int ordinal ) : short?

Attempts to type cast the specified column of a to the defined type.

AsInt16 ( this row, string columnName ) : short?

Attempts to type cast the specified column of a to the defined type.

AsInt32 ( this row, int ordinal, int valueIfNull ) : int

Attempts to type cast the specified column of a to the defined type.

AsInt32 ( this row, string columnName, int valueIfNull ) : int

Attempts to type cast the specified column of a to the defined type.

AsInt32 ( this row, int ordinal ) : int?

Attempts to type cast the specified column of a to the defined type.

AsInt32 ( this row, string columnName ) : int?

Attempts to type cast the specified column of a to the defined type.

AsInt64 ( this row, int ordinal, long valueIfNull ) : long

Attempts to type cast the specified column of a to the defined type.

AsInt64 ( this row, string columnName, long valueIfNull ) : long

Attempts to type cast the specified column of a to the defined type.

AsInt64 ( this row, int ordinal ) : long?

Attempts to type cast the specified column of a to the defined type.

AsInt64 ( this row, string columnName ) : long?

Attempts to type cast the specified column of a to the defined type.

AsSingle ( this row, int ordinal, float valueIfNull ) : float

Attempts to type cast the specified column of a to the defined type.

AsSingle ( this row, string columnName, float valueIfNull ) : float

Attempts to type cast the specified column of a to the defined type.

AsSingle ( this row, int ordinal ) : float?

Attempts to type cast the specified column of a to the defined type.

AsSingle ( this row, string columnName ) : float?

Attempts to type cast the specified column of a to the defined type.

AsString ( this row, int ordinal ) : string

Attempts to type cast the specified column of a to the defined type.

AsString ( this row, int ordinal, string valueIfNull ) : string

Attempts to type cast the specified column of a to the defined type.

AsString ( this row, string columnName ) : string

Attempts to type cast the specified column of a to the defined type.

AsString ( this row, string columnName, string valueIfNull ) : string

Attempts to type cast the specified column of a to the defined type.

AsUInt32 ( this row, int ordinal, uint valueIfNull ) : uint

Attempts to type cast the specified column of a to the defined type.

AsUInt32 ( this row, string columnName, uint valueIfNull ) : uint

Attempts to type cast the specified column of a to the defined type.

AsUInt32 ( this row, int ordinal ) : uint?

Attempts to type cast the specified column of a to the defined type.

AsUInt32 ( this row, string columnName ) : uint?

Attempts to type cast the specified column of a to the defined type.

Method Details

AsBoolean() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsBoolean ( this row, int ordinal, bool valueIfNull ) : bool
row this the row
ordinal int the index of the column
valueIfNull bool the value to replace if null
return bool

AsBoolean() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsBoolean ( this row, string columnName, bool valueIfNull ) : bool
row this the row
columnName string the column name
valueIfNull bool the value to replace if null
return bool

AsBoolean() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsBoolean ( this row, int ordinal ) : bool?
row this the row
ordinal int the index of the column
return bool?

AsBoolean() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsBoolean ( this row, string columnName ) : bool?
row this the row
columnName string the column name
return bool?

AsByte() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByte ( this row, int ordinal, byte valueIfNull ) : byte
row this the row
ordinal int the index of the column
valueIfNull byte the value to replace if null
return byte

AsByte() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByte ( this row, string columnName, byte valueIfNull ) : byte
row this the row
columnName string the column name
valueIfNull byte the value to replace if null
return byte

AsByte() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByte ( this row, int ordinal ) : byte?
row this the row
ordinal int the index of the column
return byte?

AsByte() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByte ( this row, string columnName ) : byte?
row this the row
columnName string the column name
return byte?

AsByteArray() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByteArray ( this row, int ordinal ) : byte[]
row this the row
ordinal int the index of the column
return byte[]

AsByteArray() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByteArray ( this row, int ordinal, byte valueIfNull ) : byte[]
row this the row
ordinal int the index of the column
valueIfNull byte the value to replace if null
return byte[]

AsByteArray() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByteArray ( this row, string columnName ) : byte[]
row this the row
columnName string the column name
return byte[]

AsByteArray() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsByteArray ( this row, string columnName, byte valueIfNull ) : byte[]
row this the row
columnName string the column name
valueIfNull byte the value to replace if null
return byte[]

AsDateTime() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDateTime ( this row, int ordinal, System.DateTime valueIfNull ) : System.DateTime
row this the row
ordinal int the index of the column
valueIfNull System.DateTime the value to replace if null
return System.DateTime

AsDateTime() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDateTime ( this row, string columnName, System.DateTime valueIfNull ) : System.DateTime
row this the row
columnName string the column name
valueIfNull System.DateTime the value to replace if null
return System.DateTime

AsDateTime() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDateTime ( this row, int ordinal ) : DateTime?
row this the row
ordinal int the index of the column
return DateTime?

AsDateTime() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDateTime ( this row, string columnName ) : DateTime?
row this the row
columnName string the column name
return DateTime?

AsDecimal() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDecimal ( this row, int ordinal, decimal valueIfNull ) : decimal
row this the row
ordinal int the index of the column
valueIfNull decimal the value to replace if null
return decimal

AsDecimal() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDecimal ( this row, string columnName, decimal valueIfNull ) : decimal
row this the row
columnName string the column name
valueIfNull decimal the value to replace if null
return decimal

AsDecimal() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDecimal ( this row, int ordinal ) : decimal?
row this the row
ordinal int the index of the column
return decimal?

AsDecimal() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDecimal ( this row, string columnName ) : decimal?
row this the row
columnName string the column name
return decimal?

AsDouble() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDouble ( this row, int ordinal, double valueIfNull ) : double
row this the row
ordinal int the index of the column
valueIfNull double the value to replace if null
return double

AsDouble() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDouble ( this row, string columnName, double valueIfNull ) : double
row this the row
columnName string the column name
valueIfNull double the value to replace if null
return double

AsDouble() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDouble ( this row, int ordinal ) : double?
row this the row
ordinal int the index of the column
return double?

AsDouble() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsDouble ( this row, string columnName ) : double?
row this the row
columnName string the column name
return double?

AsGuid() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsGuid ( this row, int ordinal, System.Guid valueIfNull ) : System.Guid
row this the row
ordinal int the index of the column
valueIfNull System.Guid the value to replace if null
return System.Guid

AsGuid() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsGuid ( this row, string columnName, System.Guid valueIfNull ) : System.Guid
row this the row
columnName string the column name
valueIfNull System.Guid the value to replace if null
return System.Guid

AsGuid() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsGuid ( this row, int ordinal ) : Guid?
row this the row
ordinal int the index of the column
return Guid?

AsGuid() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsGuid ( this row, string columnName ) : Guid?
row this the row
columnName string the column name
return Guid?

AsInt16() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt16 ( this row, int ordinal, short valueIfNull ) : short
row this the row
ordinal int the index of the column
valueIfNull short the value to replace if null
return short

AsInt16() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt16 ( this row, string columnName, short valueIfNull ) : short
row this the row
columnName string the column name
valueIfNull short the value to replace if null
return short

AsInt16() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt16 ( this row, int ordinal ) : short?
row this the row
ordinal int the index of the column
return short?

AsInt16() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt16 ( this row, string columnName ) : short?
row this the row
columnName string the column name
return short?

AsInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt32 ( this row, int ordinal, int valueIfNull ) : int
row this the row
ordinal int the index of the column
valueIfNull int the value to replace if null
return int

AsInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt32 ( this row, string columnName, int valueIfNull ) : int
row this the row
columnName string the column name
valueIfNull int the value to replace if null
return int

AsInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt32 ( this row, int ordinal ) : int?
row this the row
ordinal int the index of the column
return int?

AsInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt32 ( this row, string columnName ) : int?
row this the row
columnName string the column name
return int?

AsInt64() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt64 ( this row, int ordinal, long valueIfNull ) : long
row this the row
ordinal int the index of the column
valueIfNull long the value to replace if null
return long

AsInt64() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt64 ( this row, string columnName, long valueIfNull ) : long
row this the row
columnName string the column name
valueIfNull long the value to replace if null
return long

AsInt64() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt64 ( this row, int ordinal ) : long?
row this the row
ordinal int the index of the column
return long?

AsInt64() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsInt64 ( this row, string columnName ) : long?
row this the row
columnName string the column name
return long?

AsSingle() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsSingle ( this row, int ordinal, float valueIfNull ) : float
row this the row
ordinal int the index of the column
valueIfNull float the value to replace if null
return float

AsSingle() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsSingle ( this row, string columnName, float valueIfNull ) : float
row this the row
columnName string the column name
valueIfNull float the value to replace if null
return float

AsSingle() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsSingle ( this row, int ordinal ) : float?
row this the row
ordinal int the index of the column
return float?

AsSingle() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsSingle ( this row, string columnName ) : float?
row this the row
columnName string the column name
return float?

AsString() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsString ( this row, int ordinal ) : string
row this the row
ordinal int the index of the column
return string

AsString() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsString ( this row, int ordinal, string valueIfNull ) : string
row this the row
ordinal int the index of the column
valueIfNull string the value to replace if null
return string

AsString() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsString ( this row, string columnName ) : string
row this the row
columnName string the column name
return string

AsString() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsString ( this row, string columnName, string valueIfNull ) : string
row this the row
columnName string the column name
valueIfNull string the value to replace if null
return string

AsUInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsUInt32 ( this row, int ordinal, uint valueIfNull ) : uint
row this the row
ordinal int the index of the column
valueIfNull uint the value to replace if null
return uint

AsUInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsUInt32 ( this row, string columnName, uint valueIfNull ) : uint
row this the row
columnName string the column name
valueIfNull uint the value to replace if null
return uint

AsUInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsUInt32 ( this row, int ordinal ) : uint?
row this the row
ordinal int the index of the column
return uint?

AsUInt32() public static method

Attempts to type cast the specified column of a to the defined type.
public static AsUInt32 ( this row, string columnName ) : uint?
row this the row
columnName string the column name
return uint?