public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, System::Data::DataColumn ^ column, System::Data::DataRowVersion version);
public static T? Field<T>(this System.Data.DataRow row, System.Data.DataColumn column, System.Data.DataRowVersion version);
public static T Field<T>(this System.Data.DataRow row, System.Data.DataColumn column, System.Data.DataRowVersion version);
static member Field : System.Data.DataRow * System.Data.DataColumn * System.Data.DataRowVersion -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, column As DataColumn, version As DataRowVersion) As T
Type Parameters
A generic parameter that specifies the return type of the column.
ParametersThe input DataRow, which acts as the this
instance for the extension method.
A DataRowVersion enumeration that specifies the version of the column value to return, such as Current
or Original
version.
T
The value, of type T
, of the DataColumn specified by column
and version
.
The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
The column specified by column
does not exist in the DataTable that the DataRow is a part of.
A null value was assigned to a non-nullable type.
RemarksThe DataSet class represents null values with the Value instance of the DBNull class. A Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Additionally, DataSet doesn't support nullable types. The Field method provides support for accessing columns as nullable types. If the underlying value in the DataSet is DBNull.Value, the returned nullable type will have a value of null.
If the value of the specified DataColumn is null and T
is a reference type or nullable type, then the return type will be null. The Field method will not return DBNull.Value.
The Field method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the Field method. The column value should then be converted to another type.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4