DataTable.Select("(select count(*) from 表A)<number") number 属于DataTable中的列名 DataTable.Select()可以这么用吗??
呼唤远方
浏览 301回答 2
2回答
一只斗牛犬
(DataTable的Select方法的filterExpression参数只是简单的逻辑运算,达不到常规的sql语句的功能。参考例子如下:private void GetRowsByFilter(){DataTable table = DataSet1.Tables["Orders"];// Presuming the DataTable has a column named Date.string expression;expression = "Date > '1/1/00'";DataRow[] foundRows;// Use the Select method to find all rows matching the filter.foundRows = table.Select(expression);// Print column 0 of each returned row.for(int i = 0; i < foundRows.Length; i ++){Console.WriteLine(foundRows[i][0]);}}