locked
HOWTO: use a single SQL2000 database for Club Site Starter Kit RRS feed

  • Question

  • User1900542555 posted
    Unfortunately, my hosting provider doesn't have SQL Server 2005/ 2005 Express available for hosting 2.0 apps yet, but I really wanted to use the Club Site Starter kit, so I started digging around and came up with a solution.

    First things first, the infamous 'aspnetdb':
    Luckily, there's a nice little utility included with the 2.0 framework install.
    1) If you have it installed locally, browse to this folder: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    2) Double-click the application named 'aspnet_regsql.exe' and the utility will launch.
    3) When prompted, Select the radio button labeled 'Configure SQL Server for application services', then click Next
    4) Next, you have to enter your SQL Server credentials (the remote SQL Server you connect to, username, password). Also at this screen, make sure you select the database in which you will be setting up the aspnetdb tables, sprocs, etc... This is important as otherwise the utility will by default try to use 'aspnetdb' as the database against which it will execute. Note: if you are unable to browse the database names via the dropdown due to an error about 'invalid object name sysdatabases', you can just type in the name of the database you are going to be using. Also note, if you don't have the ability to execute a CREATE DATABASE command on your remote SQL Server, the database you're trying to use must already exist on the server, and the database user you're logging in as must be able to create tables, sprocs, and functions.
    5) Once you have all that established, click Next and then Next again. Note: the script(s) to create the database are a bit large, so it may take a little while to complete the final step.

    That takes care of the 'aspnetdb' portion. The next part is creating the Club Site tables and sproc's. This is actually pretty simple.
    1) Download the 'ClubAdd.exe' file from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=0dd83a11-6980-4951-a192-da6eacc6a19e&DisplayLang=en
    2) After extracting it, you'll see a file named 'club-add.sql'. all you have to do is run that sql script against the same database in which you just created the aspnetdb structure.

    Lastly, change up the connection strings in your web.config file so the app is pointing to your SQL 2000 database instead of the SQL Express database.

    That should be it. Hope this helps someone out there! :)
    Tuesday, November 8, 2005 7:55 PM

Answers

  • User1900542555 posted
    or, if you're not connecting to the database via a trusted connection (which is the case in most shared hosting environments), use the following connection strings with your relevant information.

    <add name="ClubSiteDB" providerName="System.Data.SqlClient" connectionString="server=YourDatabaseServerIPAddress;database=YourClubSiteDatabaseName;uid=YourDatabaseUserId;pwd=YourDatabasePassword"/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" providerName="System.Data.SqlClient" connectionString="server=YourDatabaseServerIPAddress;database=YourClubSiteDatabaseName;uid=YourDatabaseUserId;pwd=YourDatabasePassword"/>

    Note: You don't want to change the 'name' attribute of the connection strings. Doing so requires that you change ALL references to that connection string within your code. The code is looking for connection strings named 'ClubSiteDB' and 'LocalSqlServer'. Changing either name will break any code referencing those names.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 28, 2005 12:33 PM

All replies

  • User849259894 posted
    Hi thank you very much.  I was just looking for the tip.
    Wednesday, November 9, 2005 12:13 AM
  • User-708465017 posted

    Please bear with me, I am VERY new to ASP and programming in general. I've created the two databases on my SQL2000 server and now am attemtpting to edit the Web.config file. Here is what the default was when using SQL2005:

    <connectionStrings>

    <add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|clubsite.mdf;User Instance=True" providerName="System.Data.SqlClient"/>

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>

    </connectionStrings>


    What do change the highlighted strings to? I assume I need to change it to something like this:

    <
    connectionStrings>

    <add name="ClubSiteDB" connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|clubsite.mdf;User Instance=True" providerName="System.Data.SqlClient"/>

    <remove name="mysqlserver"/>

    <add name="mysqlserver" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>

    </connectionStrings>

    Thanks in advance,
    Rick

    Tuesday, November 22, 2005 11:56 AM
  • User2053343118 posted
    Rick
    Here is the change that I made to the connection string in the webconfig file after I created a new club database in SQL Server.


    <add name="ClubSiteDB" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Club;Data Source=YOURSERVERNAME"/>

    Club is the name that I used for the new database.

    Hope this helps.

    Craig

    Wednesday, November 23, 2005 8:03 PM
  • User1900542555 posted
    or, if you're not connecting to the database via a trusted connection (which is the case in most shared hosting environments), use the following connection strings with your relevant information.

    <add name="ClubSiteDB" providerName="System.Data.SqlClient" connectionString="server=YourDatabaseServerIPAddress;database=YourClubSiteDatabaseName;uid=YourDatabaseUserId;pwd=YourDatabasePassword"/>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" providerName="System.Data.SqlClient" connectionString="server=YourDatabaseServerIPAddress;database=YourClubSiteDatabaseName;uid=YourDatabaseUserId;pwd=YourDatabasePassword"/>

    Note: You don't want to change the 'name' attribute of the connection strings. Doing so requires that you change ALL references to that connection string within your code. The code is looking for connection strings named 'ClubSiteDB' and 'LocalSqlServer'. Changing either name will break any code referencing those names.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 28, 2005 12:33 PM