Conn.Open();
string trCount = "update FAQ set FAQ_Question = '"+TextBox1.Text.Replace("\n","<br>")+"',FAQ_Answer='"+TextBox2.Text.Replace("\n","<br>")+"',FAQ_Id='"+Session["FAQId"].ToString()+"' where FAQ_Id ='"+Session["FAQId"].ToString()+"'";
OleDbCommand MyComm = new OleDbCommand(trCount,Conn);
MyComm.ExecuteNonQuery();
Conn.Close();但运行出现这样错误:
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误:
行 75: string trCount = "update FAQ set FAQ_Question = '"+TextBox1.Text.Replace("\n","<br>")+"',FAQ_Answer='"+TextBox2.Text.Replace("\n","<br>")+"',FAQ_Id='"+Session["FAQId"].ToString()+"' where FAQ_Id ='"+Session["FAQId"].ToString()+"'";
行 76: OleDbCommand MyComm = new OleDbCommand(trCount,Conn);
行 77: MyComm.ExecuteNonQuery();
行 78:
行 79: Conn.Close();
源文件: c:\inetpub\wwwroot\purple_star\manager\modifyfaq.aspx.cs 行: 77 而我用SQLSERVER的时候却可以运行
请高手指点~
string trCount = "update FAQ set FAQ_Question = '"+TextBox1.Text.Replace("\n","<br>")+"',FAQ_Answer='"+TextBox2.Text.Replace("\n","<br>")+"',FAQ_Id='"+Session["FAQId"].ToString()+"' where FAQ_Id ='"+Session["FAQId"].ToString()+"'";
OleDbCommand MyComm = new OleDbCommand(trCount,Conn);
MyComm.ExecuteNonQuery();
Conn.Close();但运行出现这样错误:
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误:
行 75: string trCount = "update FAQ set FAQ_Question = '"+TextBox1.Text.Replace("\n","<br>")+"',FAQ_Answer='"+TextBox2.Text.Replace("\n","<br>")+"',FAQ_Id='"+Session["FAQId"].ToString()+"' where FAQ_Id ='"+Session["FAQId"].ToString()+"'";
行 76: OleDbCommand MyComm = new OleDbCommand(trCount,Conn);
行 77: MyComm.ExecuteNonQuery();
行 78:
行 79: Conn.Close();
源文件: c:\inetpub\wwwroot\purple_star\manager\modifyfaq.aspx.cs 行: 77 而我用SQLSERVER的时候却可以运行
请高手指点~
trCount "update [FAQ] set [FAQ_Question] = 'adsf',[FAQ_Answer]='asdf',[FAQ_Id]='2' where [FAQ_Id] ='2'" string
trCount "update [FAQ] set [FAQ_Question] = 'adsf',[FAQ_Answer]='asdf',[FAQ_Id]='2' where [FAQ_Id] ='2'" string三个断点得到的值就是这样的了