Foxtable(狐表)用户栏目专家坐堂 → 未将对象引用设置到对象的实例。


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

主题:未将对象引用设置到对象的实例。

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


加好友 发短信
等级:三尾狐 帖子:659 积分:5357 威望:0 精华:0 注册:2018/5/19 22:27:00
未将对象引用设置到对象的实例。  发帖心情 Post By:2024/10/11 19:07:00 [显示全部帖子]

Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView2")
Dim pn1 As WinForm.TreeNode = trv1.SelectedNode
Dim pn2 As WinForm.TreeNode = trv2.SelectedNode
Dim p1 As DataRow = pn1.DataRow
Dim p2 As DataRow = pn2.DataRow
If pn1 Is Nothing Then
MessageBox.show("请选择所属部门!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)  不选择Pn1时,我想让提示窗口提示MessageBox;但实际提示未将对象引用设置到对象的实例。
Else
    If pn2 Is Nothing Then
        MessageBox.show("请选择所属岗位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning) '不选择Pn2时,我想让提示窗口提示MessageBox;但实际提示未将对象引用设置到对象的实例。
        Else
         Dim r As Row = Tables("UserInfo").AddNew()
         r("DepartmentName") = p1("DepartmentName")
         r("DepartmentId") = p1("DepartmentId")
         r("PositionName") = p2("PositionName")
         r("PositionId") = p2("PositionId")
         End If 
End If


 回到顶部