This is a migrated thread and some comments may be shown as answers.

ActiveSkill Tutorial - ASPNETDB.MDF

2 Answers 131 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 25 Jan 2011, 01:21 AM

I do have a problem with this tutorial after all.

The steps in the ActiveSkill tutorial ask you to create a SQL db with .sql files provided in the courseware.

This all goes to plan.

I then modified my ActiveSkillUI projects web.config, adding a connection string and a couple of role/membership providers.

Those 3 things look like this.

 
<connectionStrings>
        <add name="ActiveSkillConnectionString" connectionString="Data Source=NETDEV\SqlExpress;Initial Catalog=ActiveSkill;Integrated Security=True;User Id=ActiveSkillUser;Password=a0biozasu1" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <roleManager enabled="true">
            <providers>
                <add    connectionStringName="ActiveSkillConnectionString"
                        applicationName="/ActiveSkill"
                        name="RoleProvider"
                        type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                         
            </providers>
        </roleManager>
        <membership>
            <providers>
                <clear/>
                <add    name="AspNetSqlMembershipProvider"
                        type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                        connectionStringName="ActiveSkillConnectionString"
                        enablePasswordRetrieval="false"
                        enablePasswordReset="true"
                        requiresQuestionAndAnswer="false"
                        requiresUniqueEmail="false"
                        passwordFormat="Hashed"
                        maxInvalidPasswordAttempts="3"
                        minRequiredPasswordLength="7"
                        minRequiredNonalphanumericCharacters="1"
                        passwordAttemptWindow="10"
                        passwordStrengthRegularExpression=""
                        applicationName="/ActiveSkill"/>
            </providers>
        </membership>
etc etc...


Note I have a user login created for this database. That login is confirmed and working.

My problem is that despite the efforts above, the WSAT ASP.NET Configuration app, keeps creating and using an ASPNETDB.MDF db that it is annoyingly creating in my projects  App_Data directory.

In an attempt to rid myself of this pointless database I tracked a reference to it back in the machine.config file.

In there it looked like this.

<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>

So, as a test I removed this line and put my own connectionsting in there.

However running the WSAT app again, it gets the following error.

An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 152) at System.Web. etc etc

As a final check (before posting this thread) is I searched my project for any reference to the connection string LocalSqlServer and found it does not exist.

This it a mystery to me. Anyone have some tips?

Cheers

Brad




2 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 25 Jan 2011, 09:04 AM
Hi Brad,

By default the ASP.NET Web Administration Tool is creating the roles and users in database called aspnetdb. The connection string in machine.config file lets the Visual Studio to add this database in the App_Data folder. To be able to make the tool to create the needed tables in the already created database ActiveSkill - please run the ASP.NET SQL Server Registration tool. The aspnet_regsql.exe file is located in the C:\WINDOWS\Microsoft.NET\Framework\<versionNumber>\aspnet_regsql.exe folder on your Web server. Follow the wizard and select your database ActiveSkill instead of letting the default as shown in the picture:



Please let me know if this was helpful. 

Best wishes,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Brad
Top achievements
Rank 1
answered on 26 Jan 2011, 11:38 PM
<sound of penny dropping>

That did the trick. Thanks Veronica

Brad
Tags
Documentation and Tutorials
Asked by
Brad
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Brad
Top achievements
Rank 1
Share this question
or