ArcGIS Explorer Component Help |
Table..::.GetRows Method |
Table Class Example See Also |
Returns a collection of all rows in the Table.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public RowCollection GetRows() |
Visual Basic (Declaration) |
---|
Public Function GetRows As RowCollection |
Return Value
A RowCollection object which contains Row objects each of which represents a record in the Table.Examples
The code below performs an in-memory join between a feature class and a table then iterates over all
the rows in the joined table using the GetRows method.
CopyC#
//Open Montgomery file geodatabase Geodatabase gdb = new Geodatabase(@"C:\Data\Montgomery.gdb"); //Open the parcels feature class Table parcels = gdb.OpenTable("parcels"); //Open the owners table Table owners = gdb.OpenTable("owners"); //Join the owners table to the parcels table (the cardinality is 1:1) Table parcelsOwners = parcels.Join(owners, "PROPERTY_I", "PROPERTY_ID", TableJoinType.KeepOnlyMatchingRows); //Return all the rows in the joined table printing out the 'parcel_id' value from //the parcels feature class and the 'owner_name' value from the owners table. foreach (Row joinedRow in parcelsOwners.GetRows()) { string output = string.Format("Parcel ID = {0}, Owner = {1}", joinedRow.Values["parcels.parcel_id"], joinedRow.Values["owners.owner_name"]); System.Diagnostics.Debug.Print(output); }
CopyVB.NET
'Open Montgomery file geodatabase Dim gdb As Geodatabase = New Geodatabase("C:\Data\Montgomery.gdb") 'Open the parcels feature class Dim parcels As Table = gdb.OpenTable("parcels") 'Open the owners table Dim owners As Table = gdb.OpenTable("owners") 'Join the owners table to the parcels table (the cardinality is 1:1) Dim parcelsOwners As Table = parcels.Join(owners, "PROPERTY_I", "PROPERTY_ID", TableJoinType.KeepOnlyMatchingRows) 'Return all the rows in the joined table printing out the 'parcel_id' value from 'the parcels feature class and the 'owner_name' value from the owners table. For Each joinedRow As Row In parcelsOwners.GetRows() Dim output As String = String.Format("Parcel ID = {0}, Owner = {1}", joinedRow.Values.Item("parcels.parcel_id"), _ joinedRow.Values.Item("owners.owner_name")) System.Diagnostics.Debug.Print(output) Next