以文本方式查看主题

-  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=130248)

--  作者:yuweijie
--  发布时间:2019/1/16 21:05:00
--  未将对象引用设置到对象的实例错误
Case "aqsbjcxx.htm"
    Dim sbid As String
    If e.GetValues.ContainsKey("sbid")
        sbid = e.GetValues("sbid")
    End If
    Dim dr As DataRow = DataTables("灭火器表").Find("编码 =\'" & sbid & "\'")
    wb.AddForm("","formaqsb","aqsbjcxx.htm")\'
    With wb.AddInputGroup("formaqsb","ipg1","设备信息")
        With .AddInput("bianm","编码:","text")
            .Readonly = True
            .value = dr("编码")
        End With
        With .AddInput("mingc","名称:","text")
            .Readonly = True
            .Value = dr("名称")
        End With
        With .AddInput("xingh","型号:","text")
            .Readonly = True
            .Value = dr("型号")
        End With
        With .AddInput("did","地点:","text")
            .Readonly = True
            .Value = dr("放置地点")
        End With
        With .AddInput("guanly","管理员:","text")
            .Readonly =True
            .Value = dr("管理员")
        End With
    End With
    With wb.AddTable("formaqsb","检查信息")
        .CreateFromDataTable(DataTables("灭火器检查表"),False,"编号 = \'" & sbid & "\'","检查日期 desc","检查日期","检查结果","指针图片","检查人")
    End With
    e.WriteString(wb.Build)


.NET Framework 版本:2.0.50727.8762
Foxtable 版本:2018.8.30.1
错误所在事件:项目,HttpRequest
详细错误信息:
未将对象引用设置到对象的实例。

[此贴子已经被作者于2019/1/16 21:06:05编辑过]

--  作者:有点甜
--  发布时间:2019/1/16 21:08:00
--  

加入判断

 

Dim dr As DataRow = DataTables("灭火器表").Find("编码 =\'" & sbid & "\'")

If dr IsNot Nothing Then

    \'原来代码

Else

    msgbox("没找到")

End If


--  作者:yuweijie
--  发布时间:2019/1/16 21:29:00
--  
谢谢