drFound = this.dsMsg.短信表.Select("发件人 != ''");

解决方案 »

  1.   

    DataTable.Select(string) 里用的过滤表达式,不能是Sql语句。例如下列代码:private void GetRowsByFilter()
    {
       DataTable myTable;
       myTable = DataSet1.Tables["Orders"];
       // Presuming the DataTable has a column named Date.
       string strExpr;
       strExpr = "Date > '1/1/00'";
       DataRow[] foundRows;
       // Use the Select method to find all rows matching the filter.
       foundRows = myTable.Select(strExpr);
       // Print column 0 of each returned row.
       for(int i = 0; i < foundRows.Length; i ++){
          Console.WriteLine(foundRows[i][0]);
       }
    }
      

  2.   

    这里 的过滤条件只要设置你只需要平时写的Sql语句的Where语句就可以了