Foxtable(狐表)用户栏目专家坐堂 → [求助]DateTimePicker类型转化无效


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

主题:[求助]DateTimePicker类型转化无效

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


加好友 发短信
等级:小狐 帖子:316 积分:2899 威望:0 精华:0 注册:2009/7/25 18:29:00
[求助]DateTimePicker类型转化无效  发帖心情 Post By:2019/4/16 21:40:00 [只看该作者]

老师晚上辛苦!!
请老师帮忙看一下下面的代码,执行时,总是提示“dtp”类型转化无效,不知代码 dr2("进度终止日期") = "#dtp#"应该如何修改,谢老师指导!!

Dim str As String = e.form.controls("combobox2").Value
MessageBox.show(str)
Dim Cols1() As String = {"清单项目","工程名称","工程分部","单位","合同工程量","清单单价"}
Dim Cols2() As String = {"清单项目","工程名称","工程分部","单位","合同工程量","清单单价"}
For Each dr1 As DataRow In DataTables("清单目录").Select("[工程名称] = '" & str & "'")
    Dim dtp As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")    
    Dim dr2 As DataRow = DataTables("合同执行").AddNew()    
    For Each dc As DataCol In DataTables("清单目录").DataCols        
        For i As Integer = 0 To Cols1.Length -1
            dr2(Cols2(i)) = dr1(Cols1(i))
            dr2("进度终止日期") = "#dtp#"            
        Next
    Next
Next

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


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/4/16 21:55:00 [只看该作者]

Dim str As String = e.form.controls("combobox2").Value
MessageBox.show(str)
Dim Cols1() As String = {"清单项目","工程名称","工程分部","单位","合同工程量","清单单价"}
Dim Cols2() As String = {"清单项目","工程名称","工程分部","单位","合同工程量","清单单价"}
Dim dtp As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
For Each dr1 As DataRow In DataTables("清单目录").Select("[工程名称] = '" & str & "'")
    Dim dr2 As DataRow = DataTables("合同执行").AddNew()
    dr2("进度终止日期") = dtp.Value
    For Each dc As DataCol In DataTables("清单目录").DataCols
        dr2(dc.Name)= dr1(dc.Name)
    Next
Next

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


加好友 发短信
等级:小狐 帖子:316 积分:2899 威望:0 精华:0 注册:2009/7/25 18:29:00
  发帖心情 Post By:2019/4/16 22:12:00 [只看该作者]

非常感谢老师,老师辛苦了!!!

 回到顶部