看下面的代码:
<script language="C#" runat="server">
void but_click(Object sender, EventArgs e)
{
string strid;
strid=Request.QueryString["id"];
int id=Convert.ToInt32(strid);
string strsql;
string username=Request.QueryString["username"];
string password=Request.QueryString["password"];
strsql="update admin set username='"+username+"',password='"+password+"' where adminid="+id;
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;Data Source="+Server.MapPath("new.mdb");
OleDbConnection objConnection=new OleDbConnection(strConnection);
OleDbCommand objCommand1 = new OleDbCommand(strsql,objConnection);
objConnection.Open();
objCommand1.ExecuteNonQuery();
Response.Redirect("data_list.aspx");
}
</script>
错误提示:Exception Details: System.Data.OleDb.OleDbException: UPDATE 语句的语法错误。
我想知道strsql语句应该怎么写呢,如果是sql server 这样写会出错么?
数据为何更新不了,数据库是access