What I have is a two tables. One table with users and another table with user roles. I know how to get the data out of the mysql DB, but how do I add all of those roles to my user?
I would normally thinking Session.Add but the problem is i have anywhere from 2-10 roles so any help would be grateful!
The purpose of this is I want to create a navigation bar that will display X amount of links based on whatever row they have, and also, to block certain features.
I’ve game up with this
MySqlCommand cmd2 = new MySqlCommand(storedProcedureName2, cn);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.Add("@usernameID", userID);
MySqlDataReader dr2 = cmd2.ExecuteReader();
while (dr2.Read())
{
string roleName = dr2["role"].ToString();
mysql
Roles.AddUserToRole(userID, roleName);
}
However this will not comes back with timeout contact sql server. How do I convert that to use MySQL.
I would look at implementing your own
MembershipandRolesProviders: