Fills the TableBindingAdapter with all the rows in the Table or RowCollection.

Namespace:  ESRI.ArcGISExplorer.Data

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

Syntax

C#
public void Fill()
Visual Basic (Declaration)
Public Sub Fill

Examples

The code below creates a TableBindingAdapter object for a file geodatabase feature class and fills it with all rows from the Table using the Fill method. An example is also provided to show how to then bind the adapter to a .NET DataGridView control.
CopyC#
{
  //Open the mountains fill geodatabase feature class
  Table mountains = Table.OpenFileGeodatabaseTable(@"C:\Data\Scotland.gdb", "mountains");

  //Create a new TableBindingAdapter object for the mountains Table
  TableBindingAdapter tableAdapter = new TableBindingAdapter(mountains);
  //Fill the adapter with all the rows from the mountains Table
  tableAdapter.Fill();

  //Set the UseCodedValueDomains property to display the descriptive name for the values in any
  //columns which have a CodedValueDomainDefined
  tableAdapter.UseCodedValueDomains = true;

  //Set the UseColumnAliasNames property to display alias names in the Column headers.
  tableAdapter.UseColumnAliasNames = true;        

  //Note that the BindingSource component and the DataGridView control would normally be
  //instantiated by dragging and dropping them onto a Windows Form from the toolbox.

  //Create a new BindingSource component
  System.Windows.Forms.BindingSource bindingSource1 = new System.Windows.Forms.BindingSource();
  //Set the DataSource to be the tableAdapter object
  bindingSource1.DataSource = tableAdapter;

  //Create a DataGridView control
  System.Windows.Forms.DataGridView dataGridView1 = new System.Windows.Forms.DataGridView();
  //Set the Datasource to be the bindingSource1 object 
  dataGridView1.DataSource = bindingSource1;
}
CopyVB.NET
'Open the mountains file geodatabase feature class
Dim mountainsTable As Table = Table.OpenFileGeodatabaseTable("C:\Data\Scotland.gdb", "mountains")

'Create a new TableBindingAdapter object for the mountains Table
Dim tableAdapter As TableBindingAdapter = New TableBindingAdapter(mountainsTable)

'Set the UseCodedValueDomains property to display the descriptive name for the values in any
'columns which have a CodedValueDomainDefined
tableAdapter.UseCodedValueDomains = True

'Set the UseColumnAliasNames property to display alias names in the Column headers.
tableAdapter.UseColumnAliasNames = True

'Fill the adapter with all the rows from the mountains Table
tableAdapter.Fill()

'Note that the BindingSource component and the DataGridView control would normally be
'instantiated by dragging and dropping them onto a Windows Form from the toolbox.


'Create a new BindingSource component
Dim bindingSource1 As System.Windows.Forms.BindingSource = New System.Windows.Forms.BindingSource()
'Set the DataSource to be the tableAdapter object
bindingSource1.DataSource = tableAdapter

'Create a DataGridView control
Dim dataGridView1 As System.Windows.Forms.DataGridView = New System.Windows.Forms.DataGridView()
'Set the Datasource to be the bindingSource1 object 
dataGridView1.DataSource = bindingSource1

See Also