以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]NULL (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=84861) |
-- 作者:huhu -- 发布时间:2016/5/12 9:14:00 -- [求助]NULL 后台数据的某列A值为NULL, 我在代码里面想判断一下怎么写。 1.if dr5.isnull("A") then 2.if dr5("A") = “NULL” then 3.if dr5(A) is nothing then |
-- 作者:大红袍 -- 发布时间:2016/5/12 9:16:00 -- 这种问题,你测试一下不就知道了?
if dr5.isnull("A") then
|
-- 作者:huhu -- 发布时间:2016/5/12 9:28:00 -- 我之前代码就是这么写的。用isnull。但发现去执行了蓝色的代码。注:scriptval8后台的值就是NULL Dim dr5 As DataRow = DataTables("assemblyScriptParamter").SQLFind("workOrderNo = \'" & dr3("WorkOrderNo") & "\' and lineFlag = \'" & dr2("LineFlag") & "\'") If dr5 IsNot Nothing Then If dr5.IsNull("scriptval8") Then Dim kwlb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox1") Dim rklb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox2") e.DataRow("库位类别") = kwlb.text e.DataRow("入库类别") = rklb.text e.DataRow("数量") = 1 e.DataRow("状态") = "生产结束扫描完成" e.DataRow("入库方式") = "扫描入库" e.DataRow("生产结束扫描完成时间") = Date.now e.DataRow.locked = True e.DataRow.Save Dim ssdsl As WinForm.Button = Forms("生产入库").Controls("Button3") Dim sum As Integer = DataTables("扫描配货明细").SQLCompute("Sum(数量)","状态 = \'生产结束扫描完成\'") ssdsl.text = "实扫到数量:" & sum Else If dr1("status") = "-1" Then Dim kwlb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox1") Dim rklb As WinForm.ComboBox = Forms("生产入库").Controls("ComboBox2") e.DataRow("库位类别") = kwlb.text e.DataRow("入库类别") = rklb.text e.DataRow("数量") = 1 e.DataRow("状态") = "生产结束扫描完成" e.DataRow("入库方式") = "扫描入库" e.DataRow("生产结束扫描完成时间") = Date.now e.DataRow.locked = True e.DataRow.Save Dim ssdsl As WinForm.Button = Forms("生产入库").Controls("Button3") Dim sum As Integer = DataTables("扫描配货明细").SQLCompute("Sum(数量)","状态 = \'生产结束扫描完成\'") ssdsl.text = "实扫到数量:" & sum Else
e.DataRow("数量") = 0 e.DataRow("状态") = "不符合入库条件" e.DataRow.locked = True Dim drr12 As DataRow = DataTables("生产扫描异常").Find("SN = \'" & e.DataRow("SN") & "\' and 生产订单号码工单行号 = \'" & e.DataRow("生产订单号码工单行号") & "\'") If drr12 Is Nothing Then Dim drrr12 As DataRow = DataTables("生产扫描异常").AddNew For Each nm As String In nms drrr12(nm) = e.DataRow(nm) Next drrr12("生产订单号码工单行号") = gdhhh.text drrr12("数量") = 0 drrr12("SN") = e.DataRow("SN") drrr12.Locked = True End If End If End If
|
-- 作者:大红袍 -- 发布时间:2016/5/12 9:41:00 -- msgbox(dr5("scriptval8")) msgbox(dr5.IsNull("scriptval8")) msgbox(dr5("scriptval8") = nothing)
|