Gemstone Data Library
Show/Hide TOC

# DataExtensionsConvertField T(DataRow, String) Method

Provides strongly-typed access to each of the column values in the specified row. Automatically applies type conversion to the column values.

## Definition

Namespace: Gemstone.Data.DataExtensions
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.138 -- Release Build+f7ceb3e02ea3c92b27e86b99ae16cee337a20b9e
C#
View Source Request Example

    public static T ConvertField<T>(
    	this DataRow row,
    	string field
    )

VB
View Source Request Example

    <ExtensionAttribute>
    Public Shared Function ConvertField(Of T) (
    	row As DataRow,
    	field As String
    ) As T

C++
View Source Request Example

    public:
    [ExtensionAttribute]
    generic<typename T>
    static T ConvertField(
    	DataRow^ row,
    	String^ field
    )

JavaScript
View Source Request Example

    JavaScript does not support generic types or methods.

#### Parameters

row DataRow
  The input DataRow, which acts as the instance for the extension method.
field String
  The name of the column to return the value of.

#### Type Parameters

T
  A generic parameter that specifies the return type of the column.

#### Return Value

T
The value, of type T, of the DataColumn specified by field.

#### Usage Note

In 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).

## See Also

#### Reference

DataExtensions Class
ConvertField Overload
Gemstone.Data.DataExtensions Namespace