以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 出现“此行已从表中移除并且没有任何数据”错误提示 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=47950) |
-- 作者:yankunhao -- 发布时间:2014/3/20 10:44:00 -- 出现“此行已从表中移除并且没有任何数据”错误提示 现在出现这个提示,请问是什么意思啊?
.NET Framework 版本:2.0.50727.3053 |
-- 作者:Bin -- 发布时间:2014/3/20 10:48:00 -- 错误所在事件:窗口,登陆,Button1,Click 代码发出来,或者例子发出来
|
-- 作者:yankunhao -- 发布时间:2014/3/20 10:59:00 -- Dim r As String =e.Form.Controls("ComboBox1").Value \'在用户表查找所输入用户名与密码的行 |
-- 作者:yankunhao -- 发布时间:2014/3/20 11:00:00 -- For Each dr1 As DataRow In DataTables("bgl").Select("[bnfs] = \'True\'" ) If Tables.Contains(dr1("bm")) Then Tables(dr1("bm")).AllowUnlockRow= False End If Next For Each dr1 As DataRow In DataTables("bgl").Select("[bnbj] = \'True\'" ) If Tables.Contains(dr1("bm")) Then Tables(dr1("bm")).AllowEdit = False End If Next For Each dr1 As DataRow In DataTables("bgl").Select("[sfkj] = \'True\'" ) If Tables.Contains(dr1("bm")) Then Tables(dr1("bm")).Visible = False End If Next End If If Vars("_UserGroup") <> "程序开发" Then For Each dr1 As DataRow In DataTables("授权表").Select("用户名 = \'" & Vars("_UserName")& "\'" ) If Tables.Contains(dr1("表名")) Then If dr1.IsNull("列名") Then Tables(dr1("表名")).Visible = Not dr1("不可见") Tables(dr1("表名")).AllowEdit = Not dr1("不可编辑") Else Dim nms() As String = dr1("列名").Split(",") If dr1("只能编辑部份列") = False For Each nm As String In nms Tables(dr1("表名")).Cols(nm).Visible = Not dr1("不可见") Tables(dr1("表名")).Cols(nm).AllowEdit = Not dr1("不可编辑") Next Else For Each c As Col In Tables(dr1("表名")).Cols c.AllowEdit = False Next For Each nm As String In nms Tables(dr1("表名")).Cols(nm).AllowEdit = dr1("只能编辑部份列") Next End If End If If dr1("可审核")=True Then Tables(dr1("表名")).AllowLockRow = True Else Tables(dr1("表名")).AllowLockRow = False End If If dr1("可反审核")=True Then Tables(dr1("表名")).AllowUnlockRow = True Else Tables(dr1("表名")).AllowUnlockRow = False End If If dr1("不可删除")=True Then Tables(dr1("表名")).AllowDelete = False Else Tables(dr1("表名")).AllowDelete = True End If If dr1("不可复制")=True Then DataTables(dr1("表名")).AllowClipBoard = False Else DataTables(dr1("表名")).AllowClipBoard = True End If If dr1("不可增加")=True Then DataTables(dr1("表名")).AllowAddNew = False Else DataTables(dr1("表名")).AllowAddNew = True End If End If Next End If If Tables.Contains("材料成本价格表") And Tables("材料成本价格表").Visible = True Then Tables("材料成本价格表").Cols("bom_gysname").DropForm = "供应商选择" End If \'For Each rb As RibbonMenu.Tab In RibbonTabs \'RibbonTabs是一个菜单集合,可以用for each遍历的 \'rb.Visible = True \'显示菜单 \'Next \'按用户组显示或隐藏菜单项目 If Vars("_UserGroup") <> "程序开发" Then RibbonTabs("Other")("Export")("QuickExport").Visible = False RibbonTabs("Other")("Export")("ToText").Visible = False RibbonTabs("Other")("Export")("ToXML").Visible = False Else RibbonTabs("Other")("Export")("QuickExport").Visible = True RibbonTabs("Other")("Export")("ToText").Visible = True RibbonTabs("Other")("Export")("ToXML").Visible = True End If e.Form.Close MainTable=Tables("osal_ord1") \'登陆成功 Else MessageBox.Show("用户已被暂停使用!,请与管理员联系", "提示", MessageBoxButtons.ok, MessageBoxIcon.Error) e.Form.Controls("TextBox1").Select() \'将输入焦点移到密码文本框中. End If Else MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.ok, MessageBoxIcon.Error) e.Form.Controls("TextBox1").Select() \'将输入焦点移到密码文本框中. End If |
-- 作者:yankunhao -- 发布时间:2014/3/20 11:01:00 -- 发现如果用administrator用户进去就没提示,如果用其他用户就有提示。
当关闭出错的提示后,点击那个代码按钮,就可以正常进入了。 [此贴子已经被作者于2014-3-20 11:05:35编辑过]
|
-- 作者:Bin -- 发布时间:2014/3/20 11:15:00 -- 建议您用这个方法: http://www.foxtable.com/help/topics/1485.htm 先找出是哪一行出错,然后分析原因,搞不定,贴出代码,并告诉我们运行到哪一行出错,以及错误提示。
|
-- 作者:yankunhao -- 发布时间:2014/3/20 13:44:00 -- 以下是引用Bin在2014-3-20 11:15:00的发言:
建议您用这个方法:
http://www.foxtable.com/help/topics/1485.htm
先找出是哪一行出错,然后分析原因,搞不定,贴出代码,并告诉我们运行到哪一行出错,以及错误提示。 是这里的代码问题,但我们之前都没问题的,现在2014版才会提示有错误,我删丢这段代码就没提示出错,但所有表都会显示出来了。请问为什么会这样呢?
下面这段代码的意思是,在表管理里,如果这些表名存在的话就隐藏。
For Each dr1 As DataRow In DataTables("bgl").Select("[sfkj] = \'True\'" ) |
-- 作者:Bin -- 发布时间:2014/3/20 14:05:00 -- 奇怪了,要上个例子才知道了. 正常来说,应该是你删除了这行,然后还去取值才会报这个错的. |
-- 作者:程兴刚 -- 发布时间:2014/3/20 14:09:00 -- 试试:"[sfkj] is True" |
-- 作者:程兴刚 -- 发布时间:2014/3/20 14:19:00 -- 先定义datarow集合,再遍历集合中的这些行! |