DataRowExtensions.SetField(Of T) Method (DataRow, Int32, T)
Assembly: System.Data.DataSetExtensions (in System.Data.DataSetExtensions.dll)
'Declaration <ExtensionAttribute> _ Public Shared Sub SetField(Of T) ( _ row As DataRow, _ columnIndex As Integer, _ value As T _ )
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.
- Type: System.Int32
The zero-based ordinal of the column to set the value of.
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 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.