Returns a collection of rows from the Table, given an array of unique column ID's.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public RowCollection GetRows(
	int[] objectIDs
)
Visual Basic (Declaration)
Public Function GetRows ( _
	objectIDs As Integer() _
) As RowCollection

Parameters

objectIDs
Type: array< System..::.Int32 >[]()[]

An array of unique ID's used to specify which rows return. For geodatabase tables and feature classes these will be usually be a values from the OBJECTID column, for shapefiles the FID column and dBase tables the OID column.

Return Value

A RowCollection object which contains Row objects each of which represents a record in the Table.

Examples

The code below returns three rows from a Table by passing in an integer array to the GetRows method.
CopyC#
//Open a file geodatabase feature class called mountains
Table mountainsTable = Table.OpenFileGeodatabaseTable(@"C:\Data\Scotland.gdb", "mountains");

//Get 3 rows from the Table
RowCollection rows = mountainsTable.GetRows(new int[] { 1, 2, 3 });

//Loop over the rows printing out the OBJECTID value and the 'Name' value for each row
foreach (Row mtnRow in rows)
{
  string output = string.Format("Object ID = {0}, Name = {1}", mtnRow.Values["OBJECTID"], mtnRow.Values["Name"]);
  System.Diagnostics.Debug.Print(output);
}
CopyVB.NET
'Open a file geodatabase feature class called mountains
Dim mountainsTable As Table = Table.OpenFileGeodatabaseTable("C:\Data\Scotland.gdb", "mountains")

'Get 3 rows from the Table
Dim oids As Integer() = New Integer() {1, 2, 3}
Dim rows As RowCollection = mountainsTable.GetRows(oids)

'Loop over the rows printing out the OBJECTID value and the 'Name' value for each row
For Each mtnRow As Row In rows
  Dim output As String = String.Format("Object ID = {0}, Name = {1}", mtnRow.Values.Item("OBJECTID"), mtnRow.Values.Item("Name"))
  System.Diagnostics.Debug.Print(output)
Next

See Also