Most of us need to administer the online database at some point and the WSAT seems to only allow connections to the local sql express.
Well that's no good if you need to connect to the online sql server. So here's how to connect to your online sql server database.
Also make sure the membership schema (tables and data for the ASP.Net membership) is already loaded in the online database.
All that is needed is to change the connection string inside the web.config file.
The WSAT is set to use the "LocalSqlServer" connection string.
You will find this connection string in the web.config file. Most of the time it is set to something like this
Code:
<connectionStrings>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" providerName="System.Data.SqlClient"/>
</connectionStrings>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" providerName="System.Data.SqlClient"/>
</connectionStrings>
All that is needed to connect the WSAT to the online database is to change this connection string to the online database such as:
Code:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=databasename.yourserver.com;Initial Catalog=databasename;User ID=username;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=databasename.yourserver.com;Initial Catalog=databasename;User ID=username;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
The <remove name="LocalSqlServer" /> line allows the WSAT to reset its confifuration and override the machine.config file settings.
I hope this will allow you to connect you WSAT to you online database for administration.
Have a great day
Ken



