ComponentOne DataObjects for .NET
Seek Method

C1.Data.2 Assembly > C1.Data Namespace > BaseDataTableSource Class : Seek Method
The primary key value to search for.
This parameter is undefined when the method is called. After the method returns, it contains a value indicating whether the found row contains exactly the key value the method searched for, or it is the row with the next key value in the primary key order. It is set to False if the row with exact key match was not found.
Seeks a row by its primary key values.
Syntax
'Declaration
 
Public Function Seek( _
   ByVal key() As System.Object, _
   ByRef exactMatch As System.Boolean _
) As System.Boolean
public System.bool Seek( 
   System.object[] key,
   out System.bool exactMatch
)

Parameters

key
The primary key value to search for.
exactMatch
This parameter is undefined when the method is called. After the method returns, it contains a value indicating whether the found row contains exactly the key value the method searched for, or it is the row with the next key value in the primary key order. It is set to False if the row with exact key match was not found.
Remarks
Use this method to navigate the underlying rowset in virtual mode. In virtual mode, the underlying DataTable contains only a segment of available data. To navigate the whole rowset, you need to use methods MoveFirst, MoveLast, MoveNext, MovePrevious, Seek.

This method seeks for the search key in the whole rowset. If the search key is greater than all the keys in the rowset, the method returns False. Otherwise, it finds the first row with the key greater than or equal to the search key, positions the component on the found row (so the properties BaseDataSourceComponent.Position and CurrentRow point to the found row) and returns true. It also sets the ExactMatch argument to indicate whether an exact match was found or the first row with key value greater than the search key.

See Also

Reference

BaseDataTableSource Class
BaseDataTableSource Members
C1DataTableSource Class
C1ExpressTable Class
Virtual Mode - Dealing with Large Datasets