日期:2014-05-19  浏览次数:20902 次

高分求救 字符串 '' 之前有未闭合的引号--急
我的系统运行后会显示如下错误
System.Data.SqlClient.SqlException:   第   1   行:   '13 '   附近有语法错误。字符串   ' '   之前有未闭合的引号。   at   System.Data.SqlClient.SqlCommand.ExecuteNonQuery()   at   BomSystem.signature.ibn_2_Click(Object   sender,   ImageClickEventArgs   e)   in   e:\crystal\bomsystem\signature.aspx.cs:line   391
我估计是在这段语句出错的,可是我就是不知道错在什么地方,望大家帮个忙,解决了立刻结贴
  string   CommStr= "update   count   set   靠背尺寸= ' "+this.DDL_7.SelectedItem.Text+ " ',靠背数量= "+backcount+ ",靠背尺寸2= ' "+this.DDL_44.SelectedItem.Text+ " ',靠背尺寸2数量= "+back2count+ ",靠背尺寸3= ' "+this.DDL_45.SelectedItem.Text+ " ',靠背尺寸3数量= "+back3count+ ",坐垫尺寸= ' "+this.ddl_11.SelectedItem.Text+ " ',坐垫尺寸数量= "+seatcount+ ",坐垫尺寸2= ' "+this.ddl_46.SelectedItem.Text+ " ',坐垫尺寸2数量= "+seat2count+ ",   坐垫尺寸3= ' "+this.ddl_48.SelectedItem.Text+ " ',坐垫尺寸3数量= "+seat3count+ ",坐垫规格= ' "+this.ddl_12.SelectedItem.Text+ " ',坐垫规格数量= "+seatggcount+ ",坐垫规格2= ' "+this.ddl_47.SelectedItem.Text+ " ',坐垫规格2数量= "+seatgg2count+ ",坐垫规格3= ' "+this.ddl_49.SelectedItem.Text+ " ',坐垫规格3数量= "+seatgg3count+ ",中间木扶手代码= ' "+mwoodname+ " ',中间木扶手数量= "+woodmcount+ ",左边木扶手代码= ' "+lwoodname+ " ',左边木扶手数量= "+woodlcount+ ",右边木扶手代码= ' "+rwoodname+ " ',右边木扶手数量= "+woodrcount+ ",   左边脚型号= ' "+footstr+ " ',左边脚数量= "+leftfoot+ ",   右边脚型号= ' "+rfootstr+ " ',   右边脚数量= "+rightfoot+ ",中间脚型号= ' "+mfootstr+ " ',中间脚数量= "+middlefoot+ ",中间cupholder型号= ' "+this.ddl_55.SelectedItem.Text.ToString()+ " ',中间cupholder数量= "+mcupcount+ "   ,边cupholder型号= ' "+this.ddl_8.SelectedItem.Text.ToString()+ " ',边cupholder数量= "+bcupcount+ ",TA数量= "+TAcount+ ",wing型号= ' "+this.ddl_10.SelectedItem.Text.ToString()+ " ',wing数量= "+all*2+ ",filler型号= ' "+fillername+ " ',filler数量= "+fillercount+ ",走道灯数量= "+zddcount+ ",走道灯型号= ' "+zddname+ " ',侧板型号= ' "+cebanname+ " ',侧板数量= "+cebancount+ ",侧板盖型号= ' "+cbgname+ " ',侧板盖数量= "+cbgcount+ ",行号牌型号= ' "+hhpname+ " ',行号牌数量= "+hhpcount+ ",字母牌型号= ' "+zmpname+ " ',字母牌数量= "+zmpcount+ ",数字牌型号= ' "+szpname+ ",面料名称= ' "+Fabricname+ " '中间脚cover数量= "+zjjccount+ ",数字牌数量= "+szpcount+ ",,其他要求= ' "+needs+ " '   where   ID=   '13 ' ";


------解决方案--------------------
最后部分错误比较多

数字牌型号= ' " + szpname + ",面料名称= ' " + Fabricname + " '中间脚cover数量= " + zjjccount + ",数字牌数量= " + szpcount + ",,其他要求= ' " + needs + " ' where ID= '13 ' ";
-------->
数字牌型号= ' " + szpname + " ',面料名称= ' " + Fabricname + " ',中间脚cover数量= " + zjjccount + ",数字牌数量= " + szpcount + ",其他要求= ' " + needs + " ' where ID= '13 ' ";

如果还不行,断点跟踪打印一下CommStr的内容
------解决方案--------------------
数字牌型号= ' "+szpname+ ",面料名称= ' "+Fabricname+ " '中间脚cover数量= "+zjjccount+ ",数字牌数量= "+s