I error out when I ask my datatable to select rows that are equal to a search argument.
Posted on 2004-08-19
Here is some code
If x = 1 Then
CurrRow = dt.Select("IDNUM = " & Search, "IDNUM")
If x = 2 Then
CurrRow = dt.Select("CHECKNUM = " & Search, "CHECKNUM")
If x = 3 Then
CurrRow = dt.Select("DATE" Is Search, "DATE")
The first line is comparing whats in 'search' to the column idnum. No problems and works perfectly. The second line that is done exactly the same gives me this error:
Cannot perform '=' operation on System.String and System.Int32
I have tried all kinds of combinations for this and cant figure it out. The third line happens the same way. It just shows yet another way that I tried. The only thing that I can think of is that in the table these columns come from.........IDNUM is defined numeric......Checknum and DATE are defined as text. Does this have something to do with it? If it does, how do I do a select statement and compare it to a text defined field? I cannot change the table.