源代码:
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string Temp = Request.Params["iCustomerId"];
OleDbConnection myconnection = new OleDbConnection(AccessString + System .Web .HttpContext .Current .Server.MapPath(DataBase ));
OleDbCommand mycommand;
string cmd3 = "update KHGL_CustomerPerson set cCusCode=" + cCusCode_Box.Text + ",cCusName='" + cCusName_Box.Text + "' where iCustomerId=" + Temp;
mycommand =new OleDbCommand (cmd3,myconnection );
myconnection.Open();
mycommand.ExecuteNonQuery();
Response.Write("更新成功");
myconnection.Close();
}
查看的局部变量:
cmd3="update KHGL_CustomerPerson set cCusCode='1039200506090001',cCusName='烟台华兴纸制品有限公司' where iCustomerId=11"
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string Temp = Request.Params["iCustomerId"];
OleDbConnection myconnection = new OleDbConnection(AccessString + System .Web .HttpContext .Current .Server.MapPath(DataBase ));
OleDbCommand mycommand;
string cmd3 = "update KHGL_CustomerPerson set cCusCode=" + cCusCode_Box.Text + ",cCusName='" + cCusName_Box.Text + "' where iCustomerId=" + Temp;
mycommand =new OleDbCommand (cmd3,myconnection );
myconnection.Open();
mycommand.ExecuteNonQuery();
Response.Write("更新成功");
myconnection.Close();
}
查看的局部变量:
cmd3="update KHGL_CustomerPerson set cCusCode='1039200506090001',cCusName='烟台华兴纸制品有限公司' where iCustomerId=11"
检查 字段名,表名 是否正确