如果列的數據類型是Int32
,是否可以在調用DataTable.Select(filter)
時使用通配符?c#DataTable使用Int32選擇通配符
DataTable table = new DataTable();
DataColumn column = new DataColumn("Name", typeof(String));
DataColumn column = new DataColumn("Age", typeof(Int32));
table.Select("Name like 'b%'); // Works
table.Select("Age like '3%'); // Does NOT work.
這實際工作中MySQL
,所以我只是在DataTable
懷疑其可能的。
*和%都應該做同樣的事情 - 請參閱我的答案中有效表達式的鏈接 – PinnyM 2012-02-24 14:45:37
@PinnyM:偉大的思想,我還包括鏈接。你說得對,都應該得到支持。出於某種原因,我只看到了c#中使用的星號 – kaj 2012-02-24 14:49:45