IDataRecord.GetFieldType Method (Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the Type information corresponding to the type of Object that would be returned from GetValue.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

Type GetFieldType(
	int i
)

Parameters

i
Type: System.Int32

The index of the field to find.

Return Value

Type: System.Type

The Type information corresponding to the type of Object that would be returned from GetValue.

Exception Condition
IndexOutOfRangeException

The index passed was outside the range of 0 through FieldCount.

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

.NET Framework
Available since 1.1
Return to top
Show: