以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  未将对象引用设置到对象的实例。  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=126692)

--  作者:hc-mall
--  发布时间:2018/10/26 15:11:00
--  未将对象引用设置到对象的实例。
下面的代码,执行到MessageBox.show(1)以后,就显示如下错误
.NET Framework 版本:2.0.50727.8936
Foxtable 版本:2018.8.29.1
错误所在事件:窗口,产品做法明细,xinzeng_Button3,Click
详细错误信息:
未将对象引用设置到对象的实例。

Dim cpids() As  String
Dim cpnames() As String
Dim cpsls() As String
Dim cpdws() As String
Dim cpclffs() As String
For i As Integer = 0 To Tables("做法明细").Rows.Count - 1
Dim dr As Row = Tables("做法明细").Rows(i)
If dr IsNot Nothing Then
MessageBox.show(1)
cpids(i) = dr("用料产品编号")
cpnames(i) = dr("用料产品名称")
cpsls(i) = dr("用料数量")
cpdws(i) = dr("用料单位")
cpclffs(i) = dr("用料处理方法")
MessageBox.show(4)
End If
Next
MessageBox.show(2)
Dim dr1 As DataRow = DataTables("做法表").Find("做法编号 = \'" & e.Form.Controls("zfmingxi-TextBox2").text & "\'")
If dr1 IsNot Nothing Then
MessageBox.show(3)
Dim i As Integer = (Tables("做法明细").Rows.Count - 1)
dr1("用料产品编号") = cpids(i)
dr1("用料产品名称") = cpnames(i)
dr1("用料数量") = cpsls(i)
dr1("用料单位") = cpdws(i)
dr1("用料处理方法") = cpclffs(i)
End If

--  作者:有点蓝
--  发布时间:2018/10/26 15:29:00
--  
没看懂您代码的逻辑。用文字描述一下您要实现什么功能?