SqlDataReader.GetFieldType(Int32) Method

Definition

Gets the Type that is the data type of the object.

public:
 override Type ^ GetFieldType(int i);
public:
 virtual Type ^ GetFieldType(int i);
public override Type GetFieldType (int i);
public Type GetFieldType (int i);
override this.GetFieldType : int -> Type
abstract member GetFieldType : int -> Type
override this.GetFieldType : int -> Type
Public Overrides Function GetFieldType (i As Integer) As Type
Public Function GetFieldType (i As Integer) As Type

Parameters

i
Int32

The zero-based column ordinal.

Returns

Type

The Type that is the data type of the object. If the type does not exist on the client, in the case of a User-Defined Type (UDT) returned from the database, GetFieldType returns null.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the SqlDataReader instance is cast to an IDataRecord interface.

This information can be used to increase performance by indicating the strongly-typed accessor to call. (for example, using GetInt32 is roughly ten times faster than using GetValue.)

Applies to

See also