Finding Rows in a Data Table

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

I am having a problem with finding specific rows in a
data table within a data set. I am running VB .NET and
SQL Server. I have created a form with 2 text boxes. I
have created a data set that contains one data table
which has 2 fields. I have bound each field in the data
table to one of the text boxes on the form. I have a find
button on my form which displays a second form in which
the user can enter search criteria for either field on
the original form. What I would like to do is search/find
the row in the data table using the criteria in the
second form and when a match is found on either field in
the data table, to position to that row in the data table
so that it can be displayed in the original form.

Currently I am using the select method of the data table,
however this creates a row collection of the rows that
meet the search criteria. It does not tell me the
position in the data table where the rows meeting the
criteria can be found so that I could use:

Me.BindingContext(dsDataSet, "Categories").Position = i

Where i would be the row position in the data table to
display on my form.

I have not been able to find a way to do this.
 
Where i would be the row position in the data table to
display on my form.

I have not been able to find a way to do this.

You will have to loop through all rows...
 
Back
Top