the user has more than one role , he can be admin, poweruser , executive ,etc... can anyone please tell me how can i concatenate the rodecode return by datareader if it returns more than 1 value? so that i can put it as a string in userdatastring of the authentication ticket?
eg:
If datareader returns:
UserName FullName RoleCode
amy33 amy watson ADMIN
amy33 amy watson POWERUSER
amy33 amy watson EXEC
how can i can i store all this 3 RoleCode in userdatastring?
Thank you !
Expand|Select|Wrap|Line Numbers
- drDataReader = cmd.ExecuteReader()
- While drDataReader.Read()
- strFullName = drDataReader("FullName").ToString
- strUserName = drDataReader("UserName").ToString
- strRoleCode = drDataReader("RoleCode").ToString
- userDataString = String.Concat(strFullName, "|", strUserName, "|", strRoleCode)
- Dim authCookie As HttpCookie = FormsAuthentication.GetAuthCookie(txtUserName.Text, chkPersistCookie.Checked)
- Dim ticket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(authCookie.Value)
- Dim newTicket As FormsAuthenticationTicket = New FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, ticket.IsPersistent, userDataString)