以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  应为语句结束,错在哪里呢?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=60647)

--  作者:affixed
--  发布时间:2014/11/28 12:07:00
--  应为语句结束,错在哪里呢?
甜老师,我下面的代码错在哪里?
无法保存,提示应为语句结束。把Dim dr As DataRow 下面的2行注释掉后又存在:从字符串“供方确认到货日期”到类型“Integer”的转换无效。这个错误。

Dim Cols1() As String = {"Identify","供方确认到货日期"}
Dim Cols2() As String = {"_Identify","orderSupDhTime"}
For Each dr1 As DataRow In DataTables("供方到货日期确认窗口_Table1").Select("供方确认到货日期 Is not null")
    Dim nr As Date = dr1(Cols1("供方确认到货日期"))
    Dim xh As Integer = dr1("Identify") 
    Dim dr As DataRow
    dr = DataTables("orderList").Find("[_Identify] = \'" & xh & "\'")
    dr("orderSupDhTime") = nr
    DataTables("orderList").Find("[_Identify] = \'" & xh & "\'")Cols(orderSupDhTime) = nr
Next

谢谢!
[此贴子已经被作者于2014-11-28 12:56:04编辑过]

--  作者:有点甜
--  发布时间:2014/11/28 14:04:00
--  
Dim Cols1() As String = {"Identify","供方确认到货日期"}
Dim Cols2() As String = {"_Identify","orderSupDhTime"}
For Each dr1 As DataRow In DataTables("供方到货日期确认窗口_Table1").Select("供方确认到货日期 Is not null")
    Dim nr As Date = dr1(Cols1("供方确认到货日期"))
    Dim xh As Integer = dr1("Identify")
    Dim dr As DataRow
    dr = DataTables("orderList").Find("[_Identify] = \'" & xh & "\'")
    If dr IsNot Nothing Then
        dr("orderSupDhTime") = nr
    End If
Next

--  作者:affixed
--  发布时间:2014/11/28 17:17:00
--  
甜老师,运行还是错误。
.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.10.23.1
错误所在事件:窗口,供方到货日期确认窗口,Button2,Click
详细错误信息:
从字符串“供方确认到货日期”到类型“Integer”的转换无效。
输入字符串的格式不正确。
[此贴子已经被作者于2014-11-28 17:21:34编辑过]

--  作者:有点甜
--  发布时间:2014/11/28 17:24:00
--  

For Each dr1 As DataRow In DataTables("供方到货日期确认窗口_Table1").Select("供方确认到货日期 Is not null")
    Dim xh As Integer = dr1("Identify")
    Dim dr As DataRow
    dr = DataTables("orderList").Find("[_Identify] = \'" & xh & "\'")
    If dr IsNot Nothing Then 
        Dim nr As Date = dr1("供方确认到货日期")
        dr("orderSupDhTime") = nr
    End If
Next


--  作者:affixed
--  发布时间:2014/11/28 17:36:00
--  
爱死甜老师了,问题已搞定。谢谢!