Hi,
In my database, the RoleId field for the user is "4, 3". However, it only shows Panel4.
How do I get the data read to read both value?
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim RoleId As String
Dim RoleString As String = "SELECT RoleId FROM Directory WHERE Username='" & User.Identity.Name.Trim & "' AND Archive = 'False'"
Dim cmdRole As SqlCommand = New SqlCommand(RoleString, conn)
Dim rdRole As SqlDataReader = cmdRole.ExecuteReader
If rdRole.Read Then
RoleId = rdRole("RoleId")
Else
RoleId = rdRole("")
End If
If rdRole.HasRows Then
Select Case True
Case RoleId Like "3", RoleId Like "*,3", RoleId Like "3,*"
Panel3.Visible = True
Case RoleId Like "4", RoleId Like "*,4", RoleId Like "4,*"
Panel4.Visible = True
End Select
Else
FormsAuthentication.SignOut()
FormsAuthentication.RedirectToLoginPage()
End If
rdRole.Close()
cmdRole.Dispose()
End Sub