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 8574075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:23:38+00:00 2026-06-11T19:23:38+00:00

I wish to create a summary table of all users with the database tables

  • 0

I wish to create a summary table of all users with the database tables setup according to SqlMembershipProvider schema. So far, I have:

<asp:GridView ID="UserAccounts" runat="server" AutoGenerateColumns="False">
    <Columns>
        <asp:BoundField DataField="UserName" HeaderText="UserName" />
        <asp:BoundField DataField="Email" HeaderText="Email" />
        <asp:TemplateField HeaderText="Role">
            <ItemTemplate>
                <asp:TextBox ID="RoleText" ReadOnly="true" runat="server">
                </asp:TextBox>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

for the table, and codebehind:

UserAccounts.DataSource = Membership.GetAllUsers();
UserAccounts.DataBind();

To generate the list of users. However, as those of you who are familiar with SQLmembershipprovider, the roles associated with users are housed in multiple separate tables. Therefore, I’m not sure how to retrieve that information and have it display beside each user.

The solution I am currently thinking of is to somehow traverse the table row by row and then calling Roles.GetRolesForUser() on that username to retrieve the information and then binding that to the table. However, I’m not sure of exactly how to do this and if it’s even the most efficient method.

  • 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-06-11T19:23:39+00:00Added an answer on June 11, 2026 at 7:23 pm

    Try binding to

        var userRoles = from MembershipUser user in Membership.GetAllUsers()
                        from role in Roles.GetRolesForUser(user.UserName)
                        select new { 
                            UserName = user.UserName, Email = user.Email, Role = role };
    

    or

        var userRoles = from MembershipUser user in Membership.GetAllUsers()
                        let roles = Roles.GetRolesForUser(user.UserName)
                        select new {
                            UserName = user.UserName, 
                            Email = user.Email,
                            Roles = string.Join(", ",  roles) };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to create an abstraction which represents a database table, but which can
I wish to create an external table in an Oracle database, retrieving its data
When using DataContext.CreateDatabase() to create a database, I wish to stop Linq To Sql
i wish to create a reusable ASP.NET MVC ViewUserControl which is strongly typed to
I wish to create an ASP.NET web application that allows upload of files up
i wish to create a multiplayer game facebook app. a game will have 1
I wish to create a tab application in Android. I wish to basically have
I wish to create then periodically replace content in a concrete5 CMS. I have
I wish to create a diagram similar to VS.NET class diagram. I have seen
I wish to create object of one class into another I have 2 classes

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.