Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6785587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:08:42+00:00 2026-05-26T17:08:42+00:00

What I have is a two tables. One table with users and another table

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:08:43+00:00Added an answer on May 26, 2026 at 5:08 pm

    I would look at implementing your own Membership and Roles Providers:

    • Implementing a Role Provider
    • Implementing a Membership Provider
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three tables, table one (tableA) containing users data like name and email,
I have two rating/votes tables. One for user votes and stats and another for
I have two tables, one that stores user earnings and another that stores the
I have two tables. One table contains comments on posts, another contains commenter information
I have two MySQL tables: One for items and another to log purchases. I'm
I have two tables, one is a table of forum threads. It has a
I have two tables, content and images (and a ContentImages table for the one
I have a one to many relationship between two tables. The many table contains
i have two tables one of is users: id int(11) NO PRI NULL auto_increment
I have two tables: one called Projects, and another called Documents (projects has many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.