1 ,直接使用Sql语句
string strCom = "delete from account where uid ='" + this.TextBoxUid.Text + "'";
thisCommand = new OleDbCommand(strCom,thisConnection);
thisCommand.ExecuteNonQuery();
2,使用OleDbDataAdapter.Update(DataSet) 添加数据
...
DataRow thisRow = thisDataSet.Tables["account"].NewRow();
thisRow["uid"] = this.TextBoxUid.Text;
thisRow["pwd"] = this.TextBoxPwd.Text;
...
thisDataSet.Tables["account"].Rows.Add(thisRow);
OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);
thisBuilder.QuotePrefix = "[";
thisBuilder.QuoteSuffix = "]";
thisAdapter.Update(thisDataSet,"account");
3,使用OleDbDataAdapter.Update(DataSet) 更新数据
thisAdapter.Fill(thisDataSet);
thisDataSet.Tables[0].Rows[0]["pwd"] = this.TextBoxPwd.Text;
thisDataSet.Tables[0].Rows[0]["x1"] = this.TextBoxX1.Text;
...
thisAdapter.Update(thisDataSet);
生活总是如此艰辛,不光现在而已.