Wrapping up ASP.NET Providers and remote setups

Just wanted to follow up (and close off the thread) after doing some testing and working with some remote hosts that have ASP.NET 2.0 services available.

In my previous post about the ASP.NET provider, I had pointed out that you need to override the LocalSqlServer name with whatever you wanted (if you were not using SQL Express as it was the default). At the time I was also unsure about how to setup your provider database remotely but Roger Bedell posted in the comments that you needed to run a series of scripts.

Actually there are a few options here. The main thing is that your new best friend is going to be aspnet_regsql.exe (which lives in the C:\WINDOWS\Microsoft.NET\Framework\v2.xxx folder). In order to setup a remote database, you'll need to run this and have it generate some SQL scripts for you to execute on the remote host.

If you run it with the -sqlexportonly option, you'll need to provide what features you want to turn on (or off). -A all will turn them all on (membership, role manager, profiles, and personalization). So run this from the command line:

aspnet_regsql -sqlexportonly -A all

This will create the following scripts:

09/23/2005  06:28 AM            24,603 InstallCommon.sql
09/23/2005  06:28 AM            55,833 InstallMembership.sql
09/23/2005  06:28 AM            52,339 InstallPersistSqlState.sql
09/23/2005  06:28 AM            34,950 InstallPersonalization.sql
09/23/2005  06:28 AM            20,891 InstallProfile.SQL
09/23/2005  06:28 AM            34,264 InstallRoles.sql
09/23/2005  06:28 AM            52,123 InstallSqlState.sql
09/23/2005  06:28 AM            53,895 InstallSqlStateTemplate.sql
09/23/2005  06:28 AM             6,457 InstallWebEventSqlProvider.sql

Like Rogers' comment, you need to run them in a particular order. However if you run the command with a filename you'll get them all in one single SQL script so run it like this:

aspnet_regsql -sqlexportonly MyProvider.SQL -A all

This will create a single file, MyProvider.SQL, which you can now paste in/upload and execute on your remote server. I've setup a few test systems on both GoDaddy.com and WebHost4Life and they work perfectly.

So that's it for getting your provider model setup remotely when you don't have access to the command line on the server. Enjoy.

Published Saturday, November 26, 2005 9:17 PM by Bil Simser

Comments

# re: Wrapping up ASP.NET Providers and remote setups

Sunday, November 27, 2005 6:01 AM by Jan Tielens
Great info Bill! I'm sure I need this in the near future. :)

# re: Wrapping up ASP.NET Providers and remote setups

Tuesday, November 29, 2005 3:14 PM by Wendy Daunheimer
That's great help, but I'm still having trouble with my Club Site Starter Kit on webhost4life. I've created the database just fine, but I can't access the Web Site Administration Tool for the site. I've been able to register myself as a user by going through the website interface, but something is messed up in the roles or something because I don't see the links to enter new events or photos like I should. In Visual Studio 2005, there's supposed to be an asp.net configuration option under the website menu, but it's not there when I connect to this site through ftp. I also read that I'm supposed to be able to run the tool through the url at http://mysite/webadmin.axd, but I get a 'page not found' error when I type this into the url field on even my local server. Can you help with any of this?