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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:40:18+00:00 2026-06-13T00:40:18+00:00

I am creating a new user programmatically (will be adding custom profiles later) and

  • 0

I am creating a new user programmatically (will be adding custom profiles later) and am working on Win2K8 VM:

MembershipUser newUser = 
    Membership.CreateUser(userNameTxt.Text, passwordTxt.Text, emailTxt.Text);
Roles.AddUserToRole(userNameTxt.Text.Trim(), "Member");

UPDATE:

Connection string:

<remove name="LocalSqlServer" />
<add name="LocalSqlServer" 
    connectionString="Initial Catalog=MYS;Data Source=WIN2K8;uid=MYS;password=xxxxxx;"   
    providerName="System.Data.SqlClient" />

Getting the following error:

System.Data.SqlClient.SqlException: Login failed for user ‘IIS APPPOOL\MYAPP’.

<membership>
      <providers>
        <remove name="DefaultMembershipProvider"/>
        <add 
            name="DefaultMembershipProvider" 
            type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            connectionStringName="LocalSqlServer" 
            enablePasswordRetrieval="false" 
            enablePasswordReset="false" 
            requiresQuestionAndAnswer="false" 
            requiresUniqueEmail="false" 
            minRequiredPasswordLength="6" 
            minRequiredNonalphanumericCharacters="1" 
            passwordAttemptWindow="10" 
            applicationName="/" />
            </providers>
    </membership>
    <roleManager enabled="true">
  • 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-13T00:40:19+00:00Added an answer on June 13, 2026 at 12:40 am

    You current connection string is this:

    <connectionStrings>
        <remove name="LocalSqlServer" />
        <add name="LocalSqlServer" 
        connectionString="Initial Catalog=MYS;Data Source=WIN2K8;Integrated Security=SSPI;"
        providerName="System.Data.SqlClient" />
    </connectionStrings>
    

    The error here is that you’re saying: Connect to my SQL Server database and use the App Pool identity as the ‘account’ to authenticate my SQL Server db against.

    All websites on IIS run under an ‘account’. In this case, it looks like this account is called MyApp.

    So the fix you need to have a connection string that says: Don’t use whatever ‘identity’ is setup on this IIS machine, etc. BUT! Use this hardcoded username/password instead.

    Check this out, now:

    <connectionStrings>
        <remove name="LocalSqlServer" />
        <add name="LocalSqlServer" 
        connectionString="Initial Catalog=MYS;Data Source=WIN2K8;uid=username;password=pass;"
        providerName="System.Data.SqlClient" />
    </connectionStrings>
    

    Take note:

    1. I’ve removed the argument: Integrated Security=SSPI;
    2. I’ve added the argument: uid=username;
    3. I’ve added the argument: password=pass;

    Just replace the values username and pass with the username/password you use to log into your SQL Server database.

    Need help learning about what options/keywords you can define in a single connection string? Check this ConnectionStrings site as a reference.

    Pro Tip: Instead of <remove name="whatever/> .. try using <clear/>

    eg.

    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Initial Catalog=MYS;Data Source=WIN2K8;uid=username;password=pass;" providerName="System.Data.SqlClient" />
    </connectionStrings>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using createuser wizard for creating new users. I'm not using any membership provider.
I have such view that handles user registration. After creating new user i want
So within my application is a form for creating a new user, with relevant
I'm creating a new WP theme and I would like to allow the user
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
I've been playing around with creating a new user and I keep getting this
When creating a new user in my application I'm displaying a JQuery modal popup
I have a simple create user wizard and custom membership provider which was taken
Setting role when creating new user with ASP.net MVC I am looking at the
I have a form for creating a new user. I'd like to pass a

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.