Membership provider in hosted ASP.Net environment.

D

David

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?
 
D

David

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top