asp.net.ph

DataRowCollection.Contains Method

System.Data Namespace   DataRowCollection Class


Checks whether any row in the collection contains a specified value in the primary key or keys column.

Overload List

1. Checks whether the primary key of any row in the collection contains the specified value.

2. Checks whether the primary key Column ( s ) of any row in the collection contains the values specified in the object array.


Example

The following example uses the Contains method to determine if a DataRowCollection object contains a specific value.

NOTE: This example uses one of the overloaded versions of Contains. For other examples that may be available, see the individual overload topics.

Private Sub ColContains ( )
   Dim myTable As DataTable
   Dim myRows As DataRowCollection
   myTable = myGrid.DataGridTable.DataTable
   myRows = myTable.Rows
   If myRows.Contains ( Edit1.Text ) Then
      Label1.Text = "At least one row contains " & Edit1.Text 
   Else
      Label1.Text = "No row contains the specified value"
   End If
End Sub
See Also

DataRowCollection Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note