DataRowExtensions.SetField<T> Method (DataRow, DataColumn, T)
Assembly: System.Data.DataSetExtensions (in System.Data.DataSetExtensions.dll)
A generic parameter that specifies the value type of the column.
- Type: System.Data.DataRow
The input DataRow, which acts as the this instance for the extension method.
The new row value for the specified column, of type T.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type DataRow. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
The column specified by column cannot be found.
The column is null.
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.
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.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.