以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 错误提示 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=142415) |
-- 作者:yetle -- 发布时间:2019/10/26 11:27:00 -- 错误提示 错误提示: .NET Framework 版本:4.0.30319.1 Foxtable 版本:2019.9.20.1 错误所在事件:窗口,采购需求计算,Button22,Click 详细错误信息: Unable to cast object of type \'Foxtable.WinForm.Label\' to type \'Foxtable.WinForm.ComboBox\'. 按钮代码: Dim mc As WinForm.ComboBox = Forms("采购需求计算").Controls("物料名称") Dim bm As WinForm.ComboBox = Forms("采购需求计算").Controls("物料编码") Dim ps As WinForm.ComboBox = Forms("采购需求计算").Controls("物料配色") Dim filter As String = " _identify>0 " If mc.Text > "" Then filter= filter & " and 物料名称 = \'" & mc.Text & "\'" End If If bm.Text > "" Then filter= filter & " And 物料编码 = \'" & bm.Text & "\'" End If If ps.Text > "" Then filter= filter & " And 物料配色 = \'" & ps.Text & "\'" End If Dim cmd As New SQLCommand Dim dt As DataTable cmd.C cmd.CommandText = "select * f rom 大货用量表 where 物供号=\'" & Tables("采购需求计算_table1").Current("物供号") & "\'" dt = cmd.ExecuteReader() Tables("采购需求计算_table5").DataSource =dt
|
-- 作者:有点蓝 -- 发布时间:2019/10/26 11:31:00 -- 错误的意思是上面的三个控件名称中至少有一个是label标签,而不是组合框 |
-- 作者:yetle -- 发布时间:2019/10/26 14:48:00 -- 是的,搞错了名称,谢谢,Ok了 改正确了:
Dim mc As WinForm.ComboBox = Forms("采购需求计算").Controls("物料名称") Dim bm As WinForm.ComboBox = Forms("采购需求计算").Controls("物料编码") Dim ps As WinForm.ComboBox = Forms("采购需求计算").Controls("物料配色") Dim filter As String = " _identify>0 " If mc.Text > "" Then filter= filter & " and 物料名称 = \'" & mc.Text & "\'" End If If bm.Text > "" Then filter= filter & " And 物料编码 = \'" & bm.Text & "\'" End If If ps.Text > "" Then filter= filter & " And 物料配色 = \'" & ps.Text & "\'" End If Dim cmd As New SQLCommand Dim dt As DataTable Dim tb1 As Table=Tables("采购需求计算_table1") Dim tb5 As Table=Tables("采购需求计算_table5") cmd.C cmd.CommandText = "select * f rom 大货用量表 where 物供号=\'" & tb1.Current("物供号") & "\'" dt = cmd.ExecuteReader() tb5.DataSource =dt 但是又报一个提示不存在名称为“采购需求计算_table5”的datatable的错 (Tables("采购需求计算_table5")为窗口表,绑定了表名为“大货用量表”的数据表,座位副本) |
-- 作者:有点蓝 -- 发布时间:2019/10/26 15:10:00 -- 不是这里代码提示的错误。错误提示窗口勾选详细信息看看 |