http://expert.csdn.net/Expert/topic/1618/1618108.xml?temp=.9398615请参考这个贴子

解决方案 »

  1.   

    string sCommand="create .....";
    string sConn="server=localhost;uid=sa;pwd=;database=";
    SqlConnection myConn = new SqlConnection(sConn);
    SqlDataAdapter myDataAdapter = new SqlDataAdapter();
    SqlCommandBuilder builder = new SqlCommandBuilder( mycommand ); //就是这一句没有加上去
      

  2.   

    您的OleDbDataAdapter里只有SELECTcommand
    没有猜错的话,你删掉一行也会出错.
    用上面的方法可以自动根据SELECTCOMMAND构造出其它的command
    SqlCommandBuilder builder = new SqlCommandBuilder( mycommand );