myAdapter.Fill(mySet,"[User]");
应该改为myAdapter.Fill(mySet,"User");还有就是myTable=mySet.Tables["[User]"]; 
改为myTable=mySet.Tables["User"]; 试试

解决方案 »

  1.   

    运行时还是编译时?
    myAdapter.InsertCommand .CommandText="INSERT INTO [User]"+
    "(ID,Password) VALUES('"+
    myRow["ID"]+"','"+
    myRow["Password"]+"')";
    myAdapter.InsertCommand.Connection=myConnection;
    这两句没有必要了吧
    OleDbCommandBuilder myCommandBuilder = new OleDbCommandBuilder(myAdapter);也没有啊
      

  2.   

    是运行时发生的错误!
    OleDbCommandBuilder myCommandBuilder = new OleDbCommandBuilder(myAdapter);
    这句是什么意思,我加了,好像也没用,还是老错误。
    希望帮帮忙!
      

  3.   

    用titicaca(枫叶)的做法OleDbCommandBuilder 自动帮你生成insert/update/delete
    command来对数据源进行更新,所以你要去掉你的insertcommand语句
    事实上,你的insertCommand是有错误的,正确的语句
    myAdapter.InsertCommand .CommandText="INSERT INTO [User] (ID,Password) VALUES('"
    +“(@ID,@PassWord)";
    然后设置参数@ID,@PassWord
    myAdapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.int, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(5)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Current, null));