以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]未知编译错误!  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=132607)

--  作者:bashanren
--  发布时间:2019/3/25 21:47:00
--  [求助]未知编译错误!

各位老师晚上好!!

在窗口中有一控件“Combobox1”和按钮“导入”,在导入按键的“Chik”事件中的代码如下,可在确定时提示:未知编译错误。不知错误在哪,请老师指导!谢谢老师!!

 

Dim str As String = e.combobox1.SelectedValue
MessageBox.show(str)

For Each dr1 As DataRow In DataTables("清单表").Select("[单位工程] = str")
    Dim dr2 As DataRow = DataTables("进度表").AddNew()
    For Each dc As DataCol In DataTables("清单表").DataCols
        dr2(dc.Name) = dr1(dc.name)
    Next
Next


--  作者:有点蓝
--  发布时间:2019/3/25 22:15:00
--  
Dim str As String = e.form.controls("combobox1").Value
MessageBox.show(str)
For Each dr1 As DataRow In DataTables("清单表").Select("[单位工程] = \'" & str & "\'")
    Dim dr2 As DataRow = DataTables("进度表").AddNew()
    For Each dc As DataCol In DataTables("清单表").DataCols
        dr2(dc.Name) = dr1(dc.name)
    Next
Next