GetOrdinal Method
Collapse the table of content
Expand the table of content

SqlDataRecord.GetOrdinal Method (String)

 

Returns the column ordinal specified by the column name.

Namespace:   Microsoft.SqlServer.Server
Assembly:  System.Data (in System.Data.dll)

public virtual int GetOrdinal(
	string name
)

Parameters

name
Type: System.String

The name of the column to look up.

Return Value

Type: System.Int32

The zero-based ordinal of the column as an integer.

Exception Condition
ArgumentNullException

name is null.

IndexOutOfRangeException

The column name could not be found.

InvalidCastException

There is a type mismatch.

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft