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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:16:27+00:00 2026-06-10T17:16:27+00:00

I have a membership table, which includes MemberID(int), Username(varchar16), Password… etc. How would I

  • 0

I have a membership table, which includes

MemberID(int), 
Username(varchar16), 
Password... etc.

How would I get the MemberID if I know only the username? I’m using SQL ASP.Net C#.

  • 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-10T17:16:29+00:00Added an answer on June 10, 2026 at 5:16 pm

    Since you know the value of the username. Use it as the condition in your where clause. I assumed here that username is unique or else you will have all IDs of the members that matches to the specified username.

    SELECT MemberID
    FROM Membership
    WHERE Username = 'usernameHere'
    

    try this, since you are using ADO.Net

    // other codes heres 
    string MemberID = cmd.ExecuteScalar().ToString();
    // the MemberID variable already holds the value of the ID
    // that matches your username.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table which stores membership renewals each year. When insert the
I have the models User and Group, and the join table Membership which uses
I have a table which links to another table in the ASP.NET membership schema.
I have a very basic mysql table called memberships, that tracks which people belong
I have a SHA1 password and PasswordSalt in my aspnet_Membership table. but, when I
I am using ASPNET membership with 50000 records, and we have another table called
I would like to create user in my user table when new user have
I am using asp.net membership and I have checked the table aspnet_membership and I
I have a asp.net web application which is using membership for authentication and authorization.
I have a application which I would like to add custom fields to the

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.