请问一下:有一个表(Tabel1),字段有ID(char(4)类型),Name.我用Select * From Table1 Where [ID] >'0201'语句在SQL Query Analyzer中查询就有结果出来,但用DataAdapter.Fill方法查询就没有任何记录!!!
高手们HELP ME!!!!

解决方案 »

  1.   

    public DataSet SelectSqlSrvRows(DataSet dataset,string connection) 
    {
        SqlConnection conn = new SqlConnection(connection);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand("Select * From Table1 Where [ID] >'0201'", conn);
        adapter.Fill(dataset);
        return dataset;
    }
      

  2.   

    你确定执行的那句sql?代码看看
      

  3.   

    在SQL里尽量不要用一些ID啊之类的词做字段名..好像"ID"在SQL里有另外的作用的...