DataRowExtensions.Field Metoda
Definice
Přetížení
Field<T>(DataRow, DataColumn) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, DataColumn) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, DataColumn) method also supports nullable types. |
Field<T>(DataRow, Int32) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, Int32) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, Int32) method also supports nullable types. |
Field<T>(DataRow, String) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, String) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, String) method also supports nullable types. |
Field<T>(DataRow, DataColumn, DataRowVersion) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, DataColumn, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, DataColumn, DataRowVersion) method also supports nullable types. |
Field<T>(DataRow, Int32, DataRowVersion) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, Int32, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, Int32, DataRowVersion) method also supports nullable types. |
Field<T>(DataRow, String, DataRowVersion) |
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, String, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, String, DataRowVersion) method also supports nullable types. |
Field<T>(DataRow, DataColumn)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, DataColumn) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, DataColumn) method also supports nullable types.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, System::Data::DataColumn ^ column);
public static T Field<T> (this System.Data.DataRow row, System.Data.DataColumn column);
static member Field : System.Data.DataRow * System.Data.DataColumn -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, column As DataColumn) As T
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- column
- DataColumn
Vstupní DataColumn objekt určující sloupec, jehož hodnota má být vrácena.The input DataColumn object that specifies the column to return the value of.
Návraty
Hodnota typu T
DataColumn určená parametrem column
.The value, of type T
, of the DataColumn specified by column
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec zadaný pomocí column
se nevyskytuje v rozhraní DataTable , které DataRow je součástí.The column specified by column
does not occur in the DataTable that the DataRow is a part of.
K typu, který není null, se přiřadila hodnota null .A null value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet does not support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud je DataColumn hodnota zadaného Value typu a T
je odkazový typ nebo typ s možnou hodnotou null, návratový typ bude null.If the value of the specified DataColumn is Value and T
is a reference type or nullable type, the return type will be null. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.
Field<T>(DataRow, Int32)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, Int32) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, Int32) method also supports nullable types.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, int columnIndex);
public static T Field<T> (this System.Data.DataRow row, int columnIndex);
static member Field : System.Data.DataRow * int -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, columnIndex As Integer) As T
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- columnIndex
- Int32
Index sloupceThe column index.
Návraty
Hodnota typu T
DataColumn určená parametrem columnIndex
.The value, of type T
, of the DataColumn specified by columnIndex
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec určený ordinal
v neexistuje v rozhraní DataTable , které DataRow je součástí.The column specified by ordinal
does not exist in the DataTable that the DataRow is a part of.
K typu, který není null, se přiřadila hodnota null .A null value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet doesn't support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud hodnota zadaného DataColumn má hodnotu null a T
je typu odkazu nebo typem s možnou hodnotou null, návratový typ bude 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. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.
Field<T>(DataRow, String)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, String) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, String) method also supports nullable types.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, System::String ^ columnName);
public static T Field<T> (this System.Data.DataRow row, string columnName);
static member Field : System.Data.DataRow * string -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, columnName As String) As T
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- columnName
- String
Název sloupce, pro který se má vrátit hodnotaThe name of the column to return the value of.
Návraty
Hodnota typu T
DataColumn určená parametrem columnName
.The value, of type T
, of the DataColumn specified by columnName
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec zadaný pomocí columnName
se nevyskytuje v rozhraní DataTable , které DataRow je součástí.The column specified by columnName
does not occur in the DataTable that the DataRow is a part of.
K typu, který nepovoluje hodnotu null, byla přiřazena hodnota.null
A null
value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet does not support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud hodnota zadaného DataColumn má hodnotu null a T
je typu odkazu nebo typem s možnou hodnotou null, návratový typ bude null.If the value of the specified DataColumn is null and T
is a reference type or nullable type, the return type will be null. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.
Field<T>(DataRow, DataColumn, DataRowVersion)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, DataColumn, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, DataColumn, DataRowVersion) method also supports nullable types.
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);
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
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- column
- DataColumn
Vstupní DataColumn objekt určující sloupec, jehož hodnota má být vrácena.The input DataColumn object that specifies the column to return the value of.
- version
- DataRowVersion
Výčet, který určuje verzi hodnoty sloupce, která se má vrátit, Current
například nebo Original
verze. DataRowVersionA DataRowVersion enumeration that specifies the version of the column value to return, such as Current
or Original
version.
Návraty
T
Hodnota typu DataColumn určená parametrem column
a. version
The value, of type T
, of the DataColumn specified by column
and version
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec určený column
v neexistuje v rozhraní DataTable , které DataRow je součástí.The column specified by column
does not exist in the DataTable that the DataRow is a part of.
K typu, který není null, se přiřadila hodnota null .A null value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet doesn't support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud hodnota zadaného DataColumn má hodnotu null a T
je typu odkazu nebo typem s možnou hodnotou null, návratový typ bude 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. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.
Field<T>(DataRow, Int32, DataRowVersion)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, Int32, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, Int32, DataRowVersion) method also supports nullable types.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, int columnIndex, System::Data::DataRowVersion version);
public static T Field<T> (this System.Data.DataRow row, int columnIndex, System.Data.DataRowVersion version);
static member Field : System.Data.DataRow * int * System.Data.DataRowVersion -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, columnIndex As Integer, version As DataRowVersion) As T
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- columnIndex
- Int32
Pořadové číslo sloupce založeného na nule, které vrátí hodnotu.The zero-based ordinal of the column to return the value of.
- version
- DataRowVersion
Výčet, který určuje verzi hodnoty sloupce, která se má vrátit, Current
například nebo Original
verze. DataRowVersionA DataRowVersion enumeration that specifies the version of the column value to return, such as Current
or Original
version.
Návraty
T
Hodnota typu DataColumn určená parametrem ordinal
a. version
The value, of type T
, of the DataColumn specified by ordinal
and version
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec určený ordinal
v neexistuje v rozhraní DataTable , které DataRow je součástí.The column specified by ordinal
does not exist in the DataTable that the DataRow is a part of.
K typu, který není null, se přiřadila hodnota null .A null value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet doesn't support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud hodnota zadaného DataColumn má hodnotu null a T
je typu odkazu nebo typem s možnou hodnotou null, návratový typ bude 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. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.
Field<T>(DataRow, String, DataRowVersion)
Poskytuje přístup ke všem hodnotám sloupců v zadaném řádku se silným typem.Provides strongly-typed access to each of the column values in the specified row. Field<T>(DataRow, String, DataRowVersion) Metoda také podporuje typy s možnou hodnotou null.The Field<T>(DataRow, String, DataRowVersion) method also supports nullable types.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T Field(System::Data::DataRow ^ row, System::String ^ columnName, System::Data::DataRowVersion version);
public static T Field<T> (this System.Data.DataRow row, string columnName, System.Data.DataRowVersion version);
static member Field : System.Data.DataRow * string * System.Data.DataRowVersion -> 'T
<Extension()>
Public Function Field(Of T) (row As DataRow, columnName As String, version As DataRowVersion) As T
Parametry typu
- T
Obecný parametr, který určuje návratový typ sloupce.A generic parameter that specifies the return type of the column.
Parametry
- row
- DataRow
Vstup DataRow, který funguje this
jako instance metody rozšíření.The input DataRow, which acts as the this
instance for the extension method.
- columnName
- String
Název sloupce, pro který se má vrátit hodnotaThe name of the column to return the value of.
- version
- DataRowVersion
Výčet, který určuje verzi hodnoty sloupce, která se má vrátit, Current
například nebo Original
verze. DataRowVersionA DataRowVersion enumeration that specifies the version of the column value to return, such as Current
or Original
version.
Návraty
T
Hodnota typu DataColumn určená parametrem columnName
a. version
The value, of type T
, of the DataColumn specified by columnName
and version
.
Výjimky
Typ hodnoty podkladového sloupce nelze přetypovat na typ zadaný pomocí obecného parametru T
.The value type of the underlying column could not be cast to the type specified by the generic parameter, T
.
Sloupec určený columnName
v neexistuje v rozhraní DataTable , které DataRow je součástí.The column specified by columnName
does not exist in the DataTable that the DataRow is a part of.
K typu, který není null, se přiřadila hodnota null .A null value was assigned to a non-nullable type.
Poznámky
Třída reprezentuje hodnoty null s Value instancí DBNull třídy. DataSetThe DataSet class represents null values with the Value instance of the DBNull class. Výraz, který použil sloupec s InvalidCastException hodnotou null , by vygeneroval za běhu za běhu. LINQ (Language-Integrated Query)Language-Integrated Query (LINQ)A LINQ (Language-Integrated Query)Language-Integrated Query (LINQ) expression that accessed a column with a null value would generate a InvalidCastException at run time. Kromě toho DataSet nepodporuje typy s možnou hodnotou null.Additionally, DataSet doesn't support nullable types. Field Metoda poskytuje podporu pro přístup sloupců jako typy s možnou hodnotou null.The Field method provides support for accessing columns as nullable types. Pokud DataSet je Valuepodkladovou hodnotou v hodnotě, vrácený typ s povolenou hodnotou null bude mít hodnotu null.If the underlying value in the DataSet is Value, the returned nullable type will have a value of null.
Pokud hodnota zadaného DataColumn má hodnotu null a T
je typu odkazu nebo typem s možnou hodnotou null, návratový typ bude 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. Metoda nebude vracet Value. FieldThe Field method will not return Value.
Field Metoda neprovádí převody typu.The Field method does not perform type conversions. Pokud je vyžadován převod typu, je třeba nejprve získat hodnotu sloupce pomocí Field metody.If type conversion is required, you should first obtain the column value by using the Field method. Hodnota sloupce by pak měla být převedena na jiný typ.The column value should then be converted to another type.