ASP.NET中 cmd.ExecuteNonQuery()错误System.Data.OleDb.OleDbException: 标准表达式中数据类型不匹配 20
行51:con.Open();//打开数据库连接行52:cmd.CommandText="insertintotb_zhucevalues('"+this.TextBox...
行 51: con.Open(); //打开数据库连接
行 52: cmd.CommandText = "insert into tb_zhuce values('" + this.TextBox1.Text + "','" + this.TextBox2.Text + "','" + this.DropDownList2.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + this.DropDownList3.Text + "','" + this.TextBox6.Text + "','" + this.TextBox7.Text + "','" + this.TextBox8.Text + "','" + this.TextBox9.Text + "','" + this.TextBox10.Text + "','" + this.TextBox11.Text + "','" + this.TextBox12.Text + "','" + this.TextBox13.Text + "')";
行 53: cmd.ExecuteNonQuery();//用OleDbCommand的ExecuteScalar()方法来执行添加操作
行 54: Response.Redirect("~/Default.aspx");//将该页跳转到指定的页面中
行 55: // Response.Write("<script>alert('恭喜您!!信息添加成功!');location='javascript:history.go(-1)'</script>"); 展开
行 52: cmd.CommandText = "insert into tb_zhuce values('" + this.TextBox1.Text + "','" + this.TextBox2.Text + "','" + this.DropDownList2.Text + "','" + this.TextBox4.Text + "','" + this.TextBox5.Text + "','" + this.DropDownList3.Text + "','" + this.TextBox6.Text + "','" + this.TextBox7.Text + "','" + this.TextBox8.Text + "','" + this.TextBox9.Text + "','" + this.TextBox10.Text + "','" + this.TextBox11.Text + "','" + this.TextBox12.Text + "','" + this.TextBox13.Text + "')";
行 53: cmd.ExecuteNonQuery();//用OleDbCommand的ExecuteScalar()方法来执行添加操作
行 54: Response.Redirect("~/Default.aspx");//将该页跳转到指定的页面中
行 55: // Response.Write("<script>alert('恭喜您!!信息添加成功!');location='javascript:history.go(-1)'</script>"); 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏20(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询