dotConnect for PostgreSQL Documentation
Devart.Common Namespace / DbLoaderColumnCollection Class / IndexOf Method / IndexOf(DbLoaderColumn) Method
The DbLoaderColumn object to find.
Example

In This Topic
IndexOf(DbLoaderColumn) Method
In This Topic
Gets the location in the collection of the DbLoaderColumn object.
Syntax
'Declaration
 
Public Overloads Function IndexOf( _
   ByVal value As DbLoaderColumn _
) As Integer
 

Parameters

value
The DbLoaderColumn object to find.

Return Value

The zero-based location of the DbLoaderColumn in the collection.
Example
The following example searches for a DbLoaderColumn within a DbLoaderColumnCollection. If the column exists, the example displays the index of the column. If the column does not exist, the example displays an error. This example assumes that a DbLoaderColumnCollection has already been created.
public void SearchMyColumns() {
  // ...
  // create PgSqlLoaderColumnCollection myColumns and PgSqlLoaderColumn myNewColumn
  // ...
  if (!myColumns.Contains((Object) myNewColumn))
    MessageBox.Show("ERROR: no such column in the collection");
  else
    MessageBox.Show("match on column #" +
      myColumns.IndexOf((Object) myNewColumn).ToString());
}
Public Sub SearchMyColumns()
  ' ...
  ' create PgSqlLoaderColumnCollection myColumns and PgSqlLoaderColumn myNewColumn
  ' ...
  If Not myColumns.Contains(CType(myNewColumn, Object)) Then
    MessageBox.Show("ERROR: no such column in the collection")
  Else
    MessageBox.Show("match on column #" & myColumns.IndexOf(CType(myNewColumn, Object)).ToString())
  End If
End Sub 'SearchMyColumns
See Also