以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  从类型“ComboBox”到类型“String”的转换无效  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=94524)

--  作者:刘林
--  发布时间:2016/12/25 20:32:00
--  从类型“ComboBox”到类型“String”的转换无效
Dim c1 As String =e.Form.Controls("combobox1").value 
If c1 > ""
If e.Form.controls("SplitContainer2").Select
Dim g As New GroupTableBuilder("统计表1", DataTables("成绩"))
Dim dt1 As Table = Tables("后台统计_table2")
g.filter = "考试名称 = \'"& c1 & "\'"
g.Groups.AddDef("考试名称")
g.Groups.AddDef("单位名称")


写完没出错,但运行是出现: 从类型“ComboBox”到类型“String”的转换无效。
没看出原因,请指导


--  作者:wyz20130512
--  发布时间:2016/12/25 21:20:00
--  
1.代码写在何处?
2.贴出完整的代码
[此贴子已经被作者于2016/12/25 21:29:20编辑过]

--  作者:有点色
--  发布时间:2016/12/26 0:39:00
--  

 你这段代码应该是没问题的。

 

 你应该有一段代码比如这样,才会报错

 

If e.Form.Controls("combobox1") > "" Then


--  作者:刘林
--  发布时间:2016/12/26 7:43:00
--  
谢谢老师,就是,没注意