The question about DataView.Filter
-
hi, the type of the column is "Sytem.Int32" in my datatable,for example, columnName type ---------------------- ID System.Int32 employer System.String FilterString is "ID like '%1'".When the application run at DataView.RowFilter = "ID like '%1'",I get the message that is "Cannot perform 'Like' operation on System.Int32 and System.String." Can you help me? Thanks.
-
hi, the type of the column is "Sytem.Int32" in my datatable,for example, columnName type ---------------------- ID System.Int32 employer System.String FilterString is "ID like '%1'".When the application run at DataView.RowFilter = "ID like '%1'",I get the message that is "Cannot perform 'Like' operation on System.Int32 and System.String." Can you help me? Thanks.
Internally the following query is generated. select * from Table1 where ID like '%1' like operator is spported only for string type columns eg ( varchar) So the RowFilter is incorrect. The correct query for finding all the ID's ending with 1 is select * from TestTable where (convert(int,ID) % 10 = 1)