关于更新ACESS的数据
我用ASP.NET C# 连接 ACESS 数据库
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0; ";
strConnection += @ "Data Source=~\db.mdb ";
OleDbConnection objConnection = new OleDbConnection(strConnection);
用插入语句
string strInsert = "INSERT INTO sheet1 (关系人,金额) VALUES ( ' " + DropDownList1.Text.ToString() + " ', ' " + TextBox6.Text + " ') ";
OleDbCommand objCommand = new OleDbCommand(strInsert, objConnection);
objConnection.Open();
objCommand.ExecuteNonQuery();
objConnection.Close();
运行都正常
我想使用删除和更新语句,DELETE 和 UPDATA
但是运行总是报错
请问 应该怎么写他们的代码
[解决办法]
"UPDATE sheet1 SET [金额]= ' "+Textbox2.text+ " ' WHERE [关系人]= ' "+DropDownList1.Text + " ' "