以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]遍历添加出错 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=66627) |
-- 作者:vvfree -- 发布时间:2015/4/10 18:15:00 -- [求助]遍历添加出错 Tables("物料信息临时表").AddNew Dim Texts() As String = {"TextBox1","TextBox2","TextBox3","NumericComboBox1","TextBox5","ComboBox1","TextBox6"} Dim ct() As String ={"物料名称","物料类别","物料编号","库存下限","条形码","计量单位","备注"} For Each i As String In ct For Each tex As String In Texts Tables("物料信息临时表").Current(i) = e.Form.Controls(tex).value Next Next 代码不能这样写吗,明明是字符型 怎么弹出 .NET Framework 版本:2.0.50727.5485 Foxtable 版本:2014.11.11.1 错误所在事件:窗口,物料管理,Button1,Click 详细错误信息: 从字符串“史蒂夫史蒂夫”到类型“Decimal”的转换无效。
|
-- 作者:vvfree -- 发布时间:2015/4/10 18:41:00 -- 求助啊 |
-- 作者:FoxMan -- 发布时间:2015/4/10 19:05:00 -- 两个For Next循环逻辑就不对了! Dim r as Row = Tables("物料信息临时表").AddNew Dim Texts() As String = {"TextBox1","TextBox2","TextBox3","NumericComboBox1","TextBox5","ComboBox1","TextBox6"} Dim ct() As String ={"物料名称","物料类别","物料编号","库存下限","条形码","计量单位","备注"} For i As Integer = 0 to ct.Length-1 r(ct(i)) = e.Form.Controls(Texts(i)).value Next |
-- 作者:vvfree -- 发布时间:2015/4/10 19:13:00 -- 谢谢 可以了 |