是SqlCommand
不是sqlDatasetCommand

解决方案 »

  1.   

    SqlCommand myDataSetCommand = new SqlCommand(mySelectQuery,myConnection);
      

  2.   

    sqlDatasetCommand是Beta版中的,现在是SqlCommand
      

  3.   

    我看见有文章称:在Beta 2中, DataSetCommand对象被称为DataAdapter 对象.
    我再问一个简单的问题:
    SqlCommand myCommand = new Sqlcommand(strCmd, oCN);//定义一个SqlCommand;
    SQLDataReader dr; 
    myCommand.Execute(Out dr);
    编译时提示myCommand没有Execute()这个涵数,咋回事?(上面的定义是正确的,我只写了一部分);
      

  4.   

    这句
    myCommand.Execute(Out dr);
    应该如下:
    dr = myCommand.ExecuteReader();看看msdn,这方面说得很清楚。