-- [求助]代码报错
下面这段代码执行到这儿就报错,是怎么回事
For Each rb As RibbonMenu.Tab In RibbonTabs
Dim dr1 As DataRow = DataTables("用户权限_菜单权限").SQLFind("一级菜单_名称 = \'"& rb.Name &"\' and 二级菜单_名称 is null and 三级菜单_名称 is null")
Dim sz1 As String = dr1("角色")
Dim jh1 As new List(of String)
jh1.AddRange(sz1.Split(","))
For Each str1 As String In jh1
If _usergroup.Contains(str1)
rb.Visible = True
Else
rb.Visible = False
End If
Next
For Each gp As RibbonMenu.Group In rb.Groups
Dim dr2 As DataRow = DataTables("用户权限_菜单权限").SQLFind("一级菜单_名称 = \'"& rb.Name &"\' and 二级菜单_名称 = \'"& gp.Name &"\' and 三级菜单_名称 is null")
Dim sz2 As String = dr2("角色")
Dim jh2 As new List(of String)
jh2.AddRange(sz2.Split(","))
For Each str2 As String In jh2
If _usergroup.Contains(str2)
gp.Visible = True
Else
gp.Visible = False
End If
Next
For Each itm As RibbonMenu.RibbonItem In gp.Items
Dim dr3 As DataRow = DataTables("用户权限_菜单权限").SQLFind("一级菜单_名称 = \'"& rb.Name &"\' and 二级菜单_名称 = \'"& gp.Name &"\' and 三级菜单_名称 = \'"& itm.Name &"\'")
Dim sz3 As String = dr3("角色")
Dim jh3 As new List(of String)
jh3.AddRange(sz3.Split(","))
For Each str3 As String In jh3
If _usergroup.Contains(str3)
itm.Visible = True
Else
itm.Visible = False
End If
Next
Next
Next
Next