以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 复制表的错误提示 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=28959) |
-- 作者:冰31脚 -- 发布时间:2013/2/23 22:45:00 -- 复制表的错误提示 遇到个比较麻烦的问题,
代码是
If e.DataCol.Name = "派送标记" AndAlso e.DataRow ("派送标记") = "1" Then Dim nma() As String = { "日期","项目名称","申请号","客户站点","客户申请人及电话","客户实物交接人及电话","中兴办事处确认人","设备类型*","坏件名称*" ,"派送件条码*", "客户申请时间","确认时间","到达时间","执行人","实物交接人及电话","随机编号" ,"指令类别*" } \'A表数据来源列 Dim nmb() As String = { "日期","项目名称","派送_派送申请号","客户站点","派送_派送申请人及电话","派送_派送交接人及电话","派送_派送中兴确认人及电话","设备_派送设备类型","设备_派送设备名称","设备_派送设备条码","派送_派送申请时间","派送_派送指令下达时间","派送_派送实际服务到达时间","派送_派送执行人及电话","派送_派送实物交接人及电话","随机编号" ,"指令类别" } \'B表数据接收列 Dim dr As DataRow = DataTables("系统台账").AddNew For i As Integer = 0 To nma.Length - 1 dr(nmb(i)) = e.DataRow(nma(i)) Next End If 提示如下
.NET Framework 版本:2.0.50727.5466
Foxtable 版本:2012.11.28.1 错误所在事件:表,执行单,DataColChanged 详细错误信息: System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.NullReferenceException: 未将对象引用设置到对象的实例。 在 UserCode.DataColChanged(DataColEventArgs e) --- 内部异常堆栈跟踪的结尾 --- 在 System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 在 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) 在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) 在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 在 Foxtable.DataTable.O1100l0O01l110O0l00Oll11(Object O0l0O0, DataColumnChangeEventArgs O) 麻烦帮忙看下
|
-- 作者:冰31脚 -- 发布时间:2013/2/23 23:17:00 --
发现上面的代码没有问题,是这段限制的代码出了问题,应该怎么解决?这段代码在表“系统台账”中
If Tables("执行单").Current.DataRow.GetChildRows("系统台账").Count > 0 Then
上面的代码是增加新行,这段代码是限制子表行数,父表一行只有对应一行子表,是不是冲突了? [此贴子已经被作者于2013-2-23 23:27:49编辑过]
|
-- 作者:lin_hailun -- 发布时间:2013/2/25 13:03:00 -- If Tables("执行单").Current IsNot Nothing AndAlso Tables("执行单").Current.DataRow.GetChildRows("系统台账") IsNot Nothing AndAlso Tables("执行单").Current.DataRow.GetChildRows("系统台账").Count > 0 Then e.Cancel = True End If |