4

I've created user roles with Asp.net website administration tool. I want to store these user roles in my table which are stored in SQL server. But the tool has created default connection string and has stored datas in its own table.

I've a user_role table with attributes user_id, role_id and role_name in SQL server 2008 R2. How can I connect this table to asp.net website administration tool?

I am using .NET framework 4.0, ASP.net web application, SQL server 2008 R2.

1 Answer 1

3

The default configuration is defined in your application's web.config file here:

<configuration>
    <connectionStrings>
        <add name="ApplicationServices" connectionString="data source=SERVERNAME;Initial Catalog=aspnetdb;User Id=yourusername;Password=yourpassword" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
            </providers>
        </membership>

The <connectionStrings> section will show you where you are connecting to the database, and the <membership> section shows how your membership provider is configured.

So, it sounds like you just need to change the connection string to point to the database that you set up (rather than the default aspnetdb database).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.