Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2005, 05:00 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default AddUser Help..

I'm trying to use ASP.NET 2.0's built in CreateUserWizard to add a new user to my database.

I'm using a SQL Server 2000 database, so i've changed all the necessary stuff in web.config to the right values (I think!)...however, it won't let me add a user.

I keep getting an error that it can't find "dbo.aspnet_checkschema" stored procedure. It appears as though it's looking in the AspNetDB instead of the SQL Server DB I'm trying to tell it to look at!

Here's the code..

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add name="EventDataBase" connectionString="Data Source=(local);Initial Catalog=EventDataBase;Integrated Security=True"
         providerName="System.Data.SqlClient" />
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=EventDataBase;Integrated Security=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

    <system.web>
        <authentication mode="Forms">
            <forms loginUrl="~/login.aspx" protection="All" timeout="30" requireSSL="true" name="SqlAuthCookie"/>
        </authentication>

        <authorization>
            <deny users="?" />
            <allow users="*" />
        </authorization>

        <membership>
            <providers>
                <remove name="AspNetSqlMembershipProvider"/>
                <add name="AspNetSqlMembershipProvider"
                     connectionStringName="LocalSqlServer"
                     applicationName="/"
                     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </providers>
        </membership>

        <customErrors mode="Off"/>
        <httpCookies requireSSL="true" httpOnlyCookies="true"/>
        <compilation debug="true" urlLinePragmas="true"/>
  </system.web>

    <location path="login.aspx" allowOverride="true" inheritInChildApplications="true">
        <system.web>
            <authorization/>
        </system.web>
    </location>

    <location path="images">
        <system.web>
            <authorization>
                <allow users="?" />
            </authorization>
        </system.web>
    </location>
</configuration>


When I try to add a user...i get this error message:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Can anyone help?? Thanks in advance!!!


 
Old November 23rd, 2005, 05:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Did you modify your custom database for the provider stuff? Use aspnet_regsql from the %windir%\Microsoft.NET\Framework\v2.0.50727 folder.

Either use the command line version (run it from a command prompt) and then use /? to see what options you have to add the required stuff to the database. Alternatively, just double-click the tool and follow the instructions. The graphical version of the tools adds support for *all* providers, like Membership, Roles and Profiles.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 23rd, 2005, 05:15 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help, i'll try that :)

Btw, will that tool allow me to choose whichs tables to add the new users information in?

Or does it use default tables?

For example: I'd like to store the newly created usernames and passwords in the 'Employee' table of my "EventDataBase"

 
Old November 23rd, 2005, 05:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Nope. That tool creates a bunch of tables, views and stored procedures according to a predefined naming scheme. The default providers that come with ASP.NET always use these names.

If you want to use your own tables, you'll need to create your own provider, by inheriting from an existing base class. Check out this article for more information: http://msdn.microsoft.com/library/de...ml/bucupro.asp

It shows a custom provider targeting ADAM, but the same principle applies to a different data store. There must be many more articles available, describing how to target SQL Server, so Googling a bit for the terms mentioned in the article should bring up some useful results.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ch15 adduser.asp problem beginning asp 3 ellie Access 1 December 30th, 2004 01:49 PM
Syntax error for chapter 15 AddUser.asp gymmic Classic ASP Databases 7 April 20th, 2004 02:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.