Foxtable(狐表)用户栏目专家坐堂 → 未找到类型“String”的公共成员“Else”。


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

主题:未找到类型“String”的公共成员“Else”。

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


加好友 发短信
等级:六尾狐 帖子:1458 积分:9456 威望:0 精华:0 注册:2014/12/18 16:12:00
未找到类型“String”的公共成员“Else”。  发帖心情 Post By:2020/9/22 11:13:00 [只看该作者]

'自动输入物料资料
If e.DataCol.Name = "物料编号" Then 
    Dim dr As DataRow  
    dr = DataTables("物料字典").Find("物料编号 = '" & e.DataRow("物料编号") & "'" )
    If dr IsNot Nothing 
        e.DataRow("铜铝") = dr("细分一")
        e.DataRow("单位") = dr("库存单位")
        e.DataRow("宽度类型") = dr("宽度类型")
        e.DataRow("物料名称") = dr("物料名称")
        e.DataRow("字头") = e.DataRow("物料编号").substring(0,3) 
        e.DataRow("单重") = dr("单重")
    End If

  If e.DataRow("物料编号").Endswith("SL") Then
      e.DataRow("简化物料编号") = e.DataRow("物料编号").
  Else
    If e.DataRow("物料编号").Endswith("S") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("S", "")
    ElseIf e.DataRow("物料编号").Endswith("A") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("A", "")
    ElseIf e.DataRow("物料编号").Endswith("B") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("B", "")
    ElseIf e.DataRow("物料编号").Endswith("C") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("C", "")
    ElseIf e.DataRow("物料编号").Endswith("D") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("D", "")
    ElseIf e.DataRow("物料编号").Endswith("E") Then  
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("E", "")
    ElseIf e.DataRow("物料编号").Endswith("L") Then
        e.DataRow("简化物料编号") = e.DataRow("物料编号").replace("L", "")
    Else
        e.DataRow("简化物料编号") = e.DataRow("物料编号")
    End If
  End If
End If


我的上述代码运行时会出现如下警告,请问是哪里的问题?谢谢。

.NET Framework 版本:4.0.30319.34209
Foxtable 版本:2020.5.29.8
错误所在事件:表,铝巴送货单, DataColChanged
详细错误信息:
调用的目标发生了异常。
未找到类型“String”的公共成员“Else”。


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


加好友 发短信
等级:超级版主 帖子:105948 积分:538809 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/9/22 11:21:00 [只看该作者]

  If e.DataRow("物料编号").Endswith("SL") Then
      e.DataRow("简化物料编号") = e.DataRow("物料编号").    多了一个点
  Else

 回到顶部