异常详细信息: System.Data.SqlClient.SqlException: ',' 附近有语法错误。 10
说明:执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.Data.SqlCl...
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: ',' 附近有语法错误。 源错误: 执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪: [SqlException (0x80131904): ',' 附近有语法错误。] sqlhelper.helper.ExecuteNoQuery(String sql) in D:\qichebaoming\qichebaoming\Class1.cs:74 qichebaoming.index.ImageButton1_Click(Object sender, ImageClickEventArgs e) in D:\qichebaoming\qichebaoming\index.aspx.cs:68 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
请大神看下是什么问题,我在本地中运行没有问题,放到服务器的网站中就各种报错。
string sql = "insert into baoming(name,phone,qq,diqu,car,shijia,daikuan,daogou)values(" + TextBox1.Text.ToString() + "," + TextBox2.Text.ToString() + "," + TextBox3.Text.ToString() + "," + i + "," + TextBox4.Text.ToString() + "," + j + "," + l + "," + q + ")"; 展开
请大神看下是什么问题,我在本地中运行没有问题,放到服务器的网站中就各种报错。
string sql = "insert into baoming(name,phone,qq,diqu,car,shijia,daikuan,daogou)values(" + TextBox1.Text.ToString() + "," + TextBox2.Text.ToString() + "," + TextBox3.Text.ToString() + "," + i + "," + TextBox4.Text.ToString() + "," + j + "," + l + "," + q + ")"; 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询