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

  • Home
  • SEARCH
  • 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 379153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:51:51+00:00 2026-05-12T14:51:51+00:00

I have a site using ASP.NET membership. I also have an excel file with

  • 0

I have a site using ASP.NET membership. I also have an excel file with about 60 user records. How can I import the records into the membership database, without having to type all 60 into the ASP.NET Web Site Administration Tool.

Thank you

  • 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-12T14:51:51+00:00Added an answer on May 12, 2026 at 2:51 pm
    foreach (record in recordset) {
        if (!(Roles.RoleExists(record["Role"])) {
            Roles.CreateRole(record["Role"]);
        }
        
        if (Membership.GetUser(record["Username"]) == null) {
            System.Web.Security.MembershipCreateStatus status;
            Membership.CreateUser(record["Username"], record["Password"], record["Email"], record["RSecurityQuestion"], record["SecurityAnswer"], true, status);
            if (status == System.Web.Security.MembershipCreateStatus.Success) {
                Roles.AddUserToRole(record["Username"], record["Role"]);
            }
        }
    }
    

    I can’t recall the code to create a recordset from an Excel file off the top of my head.

    EDIT: Here is a good post on how to read/write excel files with ADO.NET

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ASP.Net membership to secure my site and I have a question about
I have this membership site setup on my local machine using the ASP.NET membership
I have a ASP.NET MVC site using Membership Provider. I have trouble testing some
I have an ASP.NET 3.5 Web Site using the standard SQL Membership Provider. The
We are creating a new site using ASP.NET membership provider for user registration and
I've got a membership site using the default ASP.NET membership setup. The user accounts
I have a site using ASP.NET Membership and have a number of roles that
Our site is using ASP.Net Membership. I have a page which literally has nothing
I have a site using the asp.net membership schema. I'd like to set up
I have created a basic site using ASP.NET routing according to Mike Ormond's example

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.