改一下代码即可
If User.Type = UserTypeEnum.User Then
For Each dr As DataRow In DataTables("授权表").Select("用户名 = '" & User.Name & "'" )
If dr.IsNull("列名") Then
Tables(dr("表名")).Visible = Not dr("不可见")
Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
Else
For Each cname As String In dr("列名").split(",")
Tables(dr("表名")).Cols(cname).Visible = Not dr("不可见")
Tables(dr("表名")).Cols(cname).AllowEdit = Not dr("不可编辑")
Next
End If
Next
End If