ArcGIS Explorer Component Help |
ColumnCollection..::.Item Property (Int32) |
ColumnCollection Class Example See Also |
Gets the Column at the specified index position.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Column this[ int index ] { get; } |
Visual Basic (Declaration) |
---|
Public ReadOnly Default Property Item ( _ index As Integer _ ) As Column |
Parameters
- index
- Type: System..::.Int32
The index position of the Column to return.
Field Value
A Column object representing a set of data values of a particular ColumnType, one for each row of the Table.Examples
The code below provides two examples of returning a Column by index position.
CopyC#
//Open a file geodatabase feature class called mountains Table mountainsTable = Table.OpenFileGeodatabaseTable(@"C:\Data\Scotland.gdb", "mountains"); //Example 1 - return the index position of the Name column int nameColPosition = mountainsTable.Columns.FindColumn("Name"); System.Diagnostics.Debug.Print(nameColPosition.ToString()); //Prints "2" //Get the Name column Column nameColumn = mountainsTable.Columns[nameColPosition]; //Example 2 - return the index position of the Name column using the column alias name nameColPosition = mountainsTable.Columns.FindColumnByAliasName("Name"); System.Diagnostics.Debug.Print(nameColPosition.ToString()); //Prints "2" //Get the Name column nameColumn = mountainsTable.Columns[nameColPosition]; //Example 3 - return the Name column directly by column name nameColumn = mountainsTable.Columns["Name"];
CopyVB.NET
'Open a file geodatabase feature class called mountains Dim mountainsTable As Table = Table.OpenFileGeodatabaseTable("C:\Data\Scotland.gdb", "mountains") 'Example 1 - return the index position of the Name column Dim nameColPosition As Integer = mountainsTable.Columns.FindColumn("Name") System.Diagnostics.Debug.Print(nameColPosition.ToString()) 'Prints "2" 'Get the name column using index Dim nameColumn As Column = mountainsTable.Columns.Item(nameColPosition) 'Example 2 - return the index position of the Name column using the column alias name nameColPosition = mountainsTable.Columns.FindColumnByAliasName("Mountain Name") System.Diagnostics.Debug.Print(nameColPosition.ToString()) 'Prints "2" 'Get the name column using index nameColumn = mountainsTable.Columns.Item(nameColPosition) 'Example 3 - return the Name column directly by column name nameColumn = mountainsTable.Columns.Item("Name")