This topic has not yet been rated - Rate this topic

IDataRecord.GetFloat Method

Gets the single-precision floating point number of the specified field.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
float GetFloat(
	int i
)

Parameters

i
Type: System.Int32
The index of the field to find.

Return Value

Type: System.Single
The single-precision floating point number of the specified field.
Exception Condition
IndexOutOfRangeException

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Specified cast in invalid
The name of this method and the others could be GetAsFloat, because this method doesn't get a float. $0$0 $0 $0GetDouble gets a SQL float. GetSqlFloat could have been the name for it, but then it wouldn't convey the output type and it would confuse things further with the CLR SqlDouble type which is supposed to represent a SQL float. It's all very confusing really and I like to think that the people that made this bit have left Microsoft for jobs in the Bush administration. $0$0 $0 $0This will help with your headache: http://msdn.microsoft.com/en-us/library/ms131092.aspx$0 $0