Foxtable(狐表)用户栏目专家坐堂 → 错误提示


  共有2700人关注过本帖树形打印复制链接

主题:错误提示

帅哥哟,离线,有人找我吗?
yetle
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:858 积分:6381 威望:0 精华:0 注册:2017/2/13 9:04:00
错误提示  发帖心情 Post By: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

 回到顶部
帅哥哟,离线,有人找我吗?
yetle
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:858 积分:6381 威望:0 精华:0 注册:2017/2/13 9:04:00
  发帖心情 Post By: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")为窗口表,绑定了表名为“大货用量表”的数据表,座位副本)



 回到顶部