Android.Database.ICursor.GetColumnIndexOrThrow Method
Returns the zero-based index for the given column name, or throws Java.Lang.IllegalArgumentException if the column doesn't exist.

Syntax

[Android.Runtime.Register("getColumnIndexOrThrow", "(Ljava/lang/String;)I", "GetGetColumnIndexOrThrow_Ljava_lang_String_Handler:Android.Database.ICursorInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int GetColumnIndexOrThrow (string columnName)

See Also

ICursor.GetColumnIndex(string)

Parameters

columnName
the name of the target column.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the column does not exist

Remarks

Returns the zero-based index for the given column name, or throws Java.Lang.IllegalArgumentException if the column doesn't exist. If you're not sure if a column will exist or not use ICursor.GetColumnIndex(string) and check for -1, which is more efficient than catching the exceptions.

[Android Documentation]

Requirements

Namespace: Android.Database
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1