首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

他竟然说小弟我语法异常,哪错了

2012-08-16 
他竟然说我语法错误,哪错了?今早用asp.net和c#写一个信息更新操作 ,报错,说我update语法错误大家看看是哪

他竟然说我语法错误,哪错了?
今早用asp.net 和c#写一个信息更新操作 ,报错,说我update语法错误大家看看是哪错了,我没找到 
comm1.CommandText = "update [t2] set name='" + TextBox1.Text + "',sex='" + TextBox2.Text + "', address='" + TextBox3.Text + "', postcode='" + TextBox4.Text + "',idnumber='" + TextBox5.Text + "',bedroom='" + TextBox6.Text + "',time='" + TextBox7.Text + "',class='" + TextBox8.Text + "',major='" + TextBox9.Text + "'where id=" + Session["id"].ToString(); 

 

[解决办法]
"update [t2] set name='" + TextBox1.Text + "',sex='" + TextBox2.Text + "', address='" + TextBox3.Text + "', postcode='" + TextBox4.Text + "',idnumber='" + TextBox5.Text + "',bedroom='" + TextBox6.Text + "',time='" + TextBox7.Text + "',class='" + TextBox8.Text + "',major='" + TextBox9.Text + "'where id=" + Session["id"].ToString();

监控string是什么,放到查询分析器中看看。大不了一行一行隔开。

热点排行