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.

2 Comments

Comments have been disabled for this content.