在将 varchar 值 'System.Web.UI.WebControls.TextBox' 转换成数据类型 int 时失败
数据库中的表设计如下代码如下SqlCommandcmd=newSqlCommand();cmd.Connection=con;con.Open();cmd.Command...
数据库中的表设计如下
代码如下
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = "update homepark set placeId='" + tb_placeId + "',owner='" + tb_owner.Text + "',place='" + tb_place.Text + "',sdate='" + tb_sdate.Text + "',edate='" + tb_edate.Text + "',money='" + tb_money.Text + "',person='" + tb_person.Text + "',handle='" + ddl_handle.Text + "',memo='" + tb_memo.Text + "' where id='" +tb_id .Text + "'";
if (cmd.ExecuteNonQuery() > 0)
{
Response.Write("<script>alert('修改成功')</script>");
}
con.Close();
clbind();
"update homepark set placeId='System.Web.UI.WebControls.TextBox',owner='张三',place='3单元地下库',sdate='2013/9/27 15:00:00',edate='2013/9/27 16:00:00',money='10',person='小邓',handle='未缴纳',memo=' ' where id='桂B18668'" 就会报错说在将 varchar 值 'System.Web.UI.WebControls.TextBox' 转换成数据类型 int 时失败,怎么改啊 展开
代码如下
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
con.Open();
cmd.CommandText = "update homepark set placeId='" + tb_placeId + "',owner='" + tb_owner.Text + "',place='" + tb_place.Text + "',sdate='" + tb_sdate.Text + "',edate='" + tb_edate.Text + "',money='" + tb_money.Text + "',person='" + tb_person.Text + "',handle='" + ddl_handle.Text + "',memo='" + tb_memo.Text + "' where id='" +tb_id .Text + "'";
if (cmd.ExecuteNonQuery() > 0)
{
Response.Write("<script>alert('修改成功')</script>");
}
con.Close();
clbind();
"update homepark set placeId='System.Web.UI.WebControls.TextBox',owner='张三',place='3单元地下库',sdate='2013/9/27 15:00:00',edate='2013/9/27 16:00:00',money='10',person='小邓',handle='未缴纳',memo=' ' where id='桂B18668'" 就会报错说在将 varchar 值 'System.Web.UI.WebControls.TextBox' 转换成数据类型 int 时失败,怎么改啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询