关于数据填充后出现的问题,在线等~~~~~~
'******************************************************************************************************
'函数原型:
'函数功能:判断用户是否可以登陆本系统
'函数参数:
'函数返回:True-表示可以登陆系统,False - 表示无权限登陆系统
'创建日期:2008-05-13
'修改日期:
'******************************************************************************************************
Function LoginGrant(ByVal UserID As String, ByVal SoftwareName As String) As Boolean
Dim vSqladp As New SqlDataAdapter
Dim ds As New DataSet
vSqladp.SelectCommand = New SqlCommand
Try
vSqladp.SelectCommand.CommandText = "select LJMC from T_YHLB where YHBH='" & UserID & "'"
vSqladp.SelectCommand.Connection = SqlConn
Dim vSljmcarr(), vSljmc As String
vSqladp.Fill(ds, "T_YHLB") '=====>>执行到这句的时候提示出错:提示信息为:Invalid object name "T_YHLB"
If ds.Tables("T_YHLB").Rows.Count > 0 Then
vSljmc = ds.Tables("T_YHLB").Rows(0).Item("LJMC")
vSljmcarr = vSljmc.Split(",")
For Each s As String In vSljmcarr
If s.ToLower = SoftwareName.ToLower Then
Return True
End If
Next
Else
Return False
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
vSqladp.SelectCommand.Dispose()
vSqladp.Dispose()
ds.Dispose()
End Try
End Function