Problems comparing values in a datatable
Posted on 2006-11-09
This is the first time that I have tried to loop through a datatable. I know there are better methods to count rows but I was making sure that the loop worked. My next step is to take a value (TextBox1) and compare it to a value in each row of the datatable (tbl_WinningNumbers).
Dim tbl_WinningDrawing As New DataTable()
Dim Dr As DataRow
Dim Count As Int16
Count = 0
For Each Dr In tbl_WinningDrawing.Rows
If Me.TextBox1.Text Is Me.DataSet11.tbl_WinningNumbers.WinningDrawingColumn Then
Count = Count + 1
The problem is the syntax that I have below between the If Then part of the statement. It seems that all the tutorials and examples I find do not any reference to objects such as a textboxes, datatables, etc.
If Me.TextBox1.Text = Me.DataSet11.tbl_WinningNumbers.WinningDrawingColumn Then
Thanks for any help