private void b_Submit_Click(object sender,System.EventArgs e)
{
string Broadid=Convert.ToString(Request["Broadid"]);
int id=Convert.ToInt32(Request["id"]);
conn=new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source="+Server.MapPath("../data/patent.mdb"));
conn.Open();
cmd=new OleDbCommand("update "+Broadid+" set title=?,password=? where id=?",conn);
OleDbParameter paraTitle=new OleDbParameter("@Title",OleDbType.VarChar,50);
paraTitle.Direction=ParameterDirection.Input;
cmd.Parameters.Add(paraTitle);
paraTitle.Value=t_Title.Text;
OleDbParameter paraContent=new OleDbParameter("@Content",OleDbType.LongVarChar);
paraContent.Direction=ParameterDirection.Input;
cmd.Parameters.Add(paraContent);
paraContent.Value=t_Content.Text;
OleDbParameter paraID=new OleDbParameter("@id",OleDbType.Integer);
paraID.Direction=ParameterDirection.Input;
cmd.Parameters.Add(paraID);
paraID.Value=id;
cmd.ExecuteNonQuery();
conn.Close();
conn.Dispose();
cmd.Dispose();
Response.Redirect("Display.aspx?Broadid="+Broadid);
}
[OleDbException (0x80040e14): INSERT INTO 语句的语法错误。]
我怎么觉得语法没什么错误啊,我修改的一段代码也提示语法错误,提示是UPDATE语法错误,WHY???