Testing some code to set a row filter on a table with an integer column using the bit "And" operator.
Can't seem to get it to work.
Sadly I think I ran across this a while ago and don't remember how I got around it.
I've tried changing the Int32 to Int16, but did not help.
I get an error something like the following.
".net cannot perform 'and' operation on system.int32 and system.int32"
Must be something simple I'm missing.
Can I not use an integer as large as Int32?
Auguy
Sylvania/Toledo Ohio
Can't seem to get it to work.
Sadly I think I ran across this a while ago and don't remember how I got around it.
Code:
Dim myTable As New DataTable
myTable.Columns.Add("Desc", Type.GetType("System.String"))
myTable.Columns.Add("KeyNbr", Type.GetType("System.Int32"))
myTable.Rows.Add("Open", 2)
myTable.Rows.Add("Hold", 4)
myTable.Rows.Add("Covered", 8)
myTable.Rows.Add("Complete", 16)
Dim Compare As Integer = 10
myTable.DefaultView.RowFilter = "(KeyNbr And " & Compare.ToString & ") > 0"
I get an error something like the following.
".net cannot perform 'and' operation on system.int32 and system.int32"
Must be something simple I'm missing.
Can I not use an integer as large as Int32?
Auguy
Sylvania/Toledo Ohio