StringBuilder s = new StringBuilder();this.ddlGoodsClassName.SelectedValue = "3";s=s .Append("0");s=s.Append(this.ddlGoodsClassName.SelectedValue.ToString().Trim()); s=s.Append("000001");goods.GoodsId =Convert.ToString(s);执行后显示的依然是3,而我要的效果是03000001,如何解决?
2 回答
临摹微笑
TA贡献1982条经验 获得超2个赞
StringBuilder s = new StringBuilder();//对的
this.ddlGoodsClassName.SelectedValue = "3";
s=s .Append("0");//错的,而直接:s .Append("0")
s=s.Append(this.ddlGoodsClassName.SelectedValue.ToString().Trim()); //和上面一样!不用等于!
s=s.Append("000001");//同上
goods.GoodsId =Convert.ToString(s);//goods.GoodsId = s.ToString()
- 2 回答
- 0 关注
- 529 浏览
添加回答
举报
0/150
提交
取消