A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.data.datarowextensions.setfield below:

DataRowExtensions.SetField Method (System.Data) | Microsoft Learn

DataRowExtensions.SetField Method Definition

Sets a new value for the specified column in the DataRow.

Overloads SetField<T>(DataRow, DataColumn, T)

Sets a new value for the specified column in the DataRow. The SetField<T>(DataRow, DataColumn, T) method also supports nullable types.

SetField<T>(DataRow, Int32, T)

Sets a new value for the specified column in the DataRow the method is called on. The SetField<T>(DataRow, Int32, T) method also supports nullable types.

SetField<T>(DataRow, String, T)

Sets a new value for the specified column in the DataRow. The SetField<T>(DataRow, String, T) method also supports nullable types.

SetField<T>(DataRow, DataColumn, T)
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void SetField(System::Data::DataRow ^ row, System::Data::DataColumn ^ column, T value);
public static void SetField<T>(this System.Data.DataRow row, System.Data.DataColumn column, T? value);
public static void SetField<T>(this System.Data.DataRow row, System.Data.DataColumn column, T value);
static member SetField : System.Data.DataRow * System.Data.DataColumn * 'T -> unit
<Extension()>
Public Sub SetField(Of T) (row As DataRow, column As DataColumn, value As T)
Type Parameters
T

A generic parameter that specifies the value type of the column.

Parameters
row
DataRow

The input DataRow, which acts as the this instance for the extension method.

value
T

The new row value for the specified column, of type T.

Exceptions

The column specified by column cannot be found.

Occurs when attempting to set a value on a deleted row.

The value type of the underlying column could not be cast to the type specified by the generic parameter, T.

Remarks

If value is null, the SetField method converts the null value to DBNull.Value in the underlying DataColumn.

The SetField method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The SetField method exposes the ADO.NET 2.0 behavior of the DataRow class. A type conversion could be performed by the DataRow object and the converted value would then be saved to the row.

Exceptions can be passed up through the SetField method from the underlying DataRow object.

SetField<T>(DataRow, Int32, T)
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void SetField(System::Data::DataRow ^ row, int columnIndex, T value);
public static void SetField<T>(this System.Data.DataRow row, int columnIndex, T? value);
public static void SetField<T>(this System.Data.DataRow row, int columnIndex, T value);
static member SetField : System.Data.DataRow * int * 'T -> unit
<Extension()>
Public Sub SetField(Of T) (row As DataRow, columnIndex As Integer, value As T)
Type Parameters
T

A generic parameter that specifies the value type of the column.

Parameters
row
DataRow

The input DataRow, which acts as the this instance for the extension method.

columnIndex
Int32

The zero-based ordinal of the column to set the value of.

value
T

The new row value for the specified column, of type T.

Exceptions

Occurs when attempting to set a value on a deleted row.

The columnIndex argument is out of range.

The value type of the underlying column could be not cast to the type specified by the generic parameter, T.

Remarks

If value is null, the SetField method converts the null value to DBNull.Value in the underlying DataColumn.

The SetField method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The SetField method exposes the ADO.NET 2.0 behavior of the DataRow class. A type conversion could be performed by the DataRow object and the converted value would then be saved to the row.

Exceptions can be passed up through the SetField method from the underlying DataRow object.

SetField<T>(DataRow, String, T)
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
Source:
DataRowExtensions.cs
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void SetField(System::Data::DataRow ^ row, System::String ^ columnName, T value);
public static void SetField<T>(this System.Data.DataRow row, string columnName, T? value);
public static void SetField<T>(this System.Data.DataRow row, string columnName, T value);
static member SetField : System.Data.DataRow * string * 'T -> unit
<Extension()>
Public Sub SetField(Of T) (row As DataRow, columnName As String, value As T)
Type Parameters
T

A generic parameter that specifies the value type of the column.

Parameters
row
DataRow

The input DataRow, which acts as the this instance for the extension method.

columnName
String

The name of the column to set the value of.

value
T

The new row value for the specified column, of type T.

Exceptions

The column specified by columnName cannot be found.

Occurs when attempting to set a value on a deleted row.

The value type of the underlying column could not be cast to the type specified by the generic parameter, T.

Remarks

If value is null, the SetField method converts the null value to DBNull.Value in the underlying DataColumn.

The SetField method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The SetField method exposes the ADO.NET 2.0 behavior of the DataRow class. A type conversion could be performed by the DataRow object and the converted value would then be saved to the row.

Exceptions can be passed up through the SetField method from the underlying DataRow object.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


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