Membership provider in hosted ASP.Net environment.

Discussion in 'ASP .Net Security' started by David, Jan 12, 2008.

  1. David

    David Guest

    I recently set up a new ASP.NET web page, the first one I've ever done in a
    real, honest to goodness server that wasn't my local machine. I've got a web
    hosting service (from oneandone, in case anyone knows it.)

    I would very much like to use the membership services. On my local machine
    I have SQLServer Express, I use the defaults. Everything works.

    Now. though. I want to use membership on the "real" web page, with my real
    domain and everything. Part of the low cost package that I have is that I
    can create only one SQL Server 2005 database. Of course, I need that one to
    store the various bits of data that my page will present. So, what should I
    use as my membership provider?

    I tried just using that database to store the membership information, too,
    by creating a <membership> section in the web.config, and using the
    connection string that points to my database, the same one that has the
    application data. That didn't work. After I typed in a name on the
    CreateUserWizard, I got

    "Server Error in '/WebSite1' Application.
    --------------------------------------------------------------------------------

    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 "

    Can anyone point me toward an example of using the membership provider using
    a sqlserver database other than the default one? Can it be done?
     
    David, Jan 12, 2008
    #1
    1. Advertising

  2. David

    David Guest

    I figured out the solution. For anyone who might have stumbled on this
    through a search, here is the answer:

    You must run aspnet_regsql on a database. That creates the necessary
    tables. Since you are using a hosted environment, you aren't going to be
    able to run the system on the target hardware. What you have to do is run it
    on your local machine, using a copy of your database, and then upload that
    copy to the host machine.

    In my case, I had to export my database from my host enviornment. (Shut
    down the web site for a while, so that no one adds anything new to the
    database.) Copy that data from my host to my development machine. Restore
    the database to my local machine. After restoration, run aspnet_regsql
    against that database. That adds new tables to the database. Now, do a
    backup on your local machine. Copy the backup file to the host. Do an
    import on the host, importing the backup file you just made. Point the
    membership provider in web.config to the database you just modified.

    You now have a membership provider.

    "David" wrote:

    > I recently set up a new ASP.NET web page, the first one I've ever done in a
    > real, honest to goodness server that wasn't my local machine. I've got a web
    > hosting service (from oneandone, in case anyone knows it.)
    >
    > I would very much like to use the membership services. On my local machine
    > I have SQLServer Express, I use the defaults. Everything works.
    >
    > Now. though. I want to use membership on the "real" web page, with my real
    > domain and everything. Part of the low cost package that I have is that I
    > can create only one SQL Server 2005 database. Of course, I need that one to
    > store the various bits of data that my page will present. So, what should I
    > use as my membership provider?
    >
    > I tried just using that database to store the membership information, too,
    > by creating a <membership> section in the web.config, and using the
    > connection string that points to my database, the same one that has the
    > application data. That didn't work. After I typed in a name on the
    > CreateUserWizard, I got
    >
    > "Server Error in '/WebSite1' Application.
    > --------------------------------------------------------------------------------
    >
    > 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 "
    >
    > Can anyone point me toward an example of using the membership provider using
    > a sqlserver database other than the default one? Can it be done?
     
    David, Jan 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James X. Li
    Replies:
    1
    Views:
    407
    Jerry Boone
    Jan 2, 2004
  2. sloan
    Replies:
    5
    Views:
    1,515
    sloan
    Jun 4, 2006
  3. =?Utf-8?B?SXbDoW4gU2Fpbno=?=

    Problems deploying membership on a hosted environment

    =?Utf-8?B?SXbDoW4gU2Fpbno=?=, Apr 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    412
    =?Utf-8?B?SXbDoW4gU2Fpbno=?=
    Apr 10, 2007
  4. sloan
    Replies:
    1
    Views:
    514
    Chad Scharf
    Jul 3, 2007
  5. Iván Sainz

    Problems deploying membership on a hosted environment

    Iván Sainz, Apr 10, 2007, in forum: ASP .Net Security
    Replies:
    2
    Views:
    148
    Iván Sainz
    Apr 10, 2007
Loading...

Share This Page