Deploy starter kit to remote host

Last updated: Added Step 8 on 06/18/2006

Both Personal and Club site starter kit should works fine right out of box on local machine with SQL Express backend. There are quit a few people expressed the frustration to make it work on remote server. Instead of reply one by one, I throw a quick step by step tutorial here. Hope you find it helpful.


Step 1 - Pick a good host company.
Choose a reliable host that supports ASP.NET 2.0. Usually your host company will provide MS SQL Server 2000 or 2005 with additional charge. Upload all files to server.

Updated: I recommend use host company that allow remote connection for SQL Server, and ideally supports .NET 2.0 role manager. Some host companies turn off these functions for various reasons.

Step 2 - Run SQL installation script against your remote sql server. ASPNETDB.MDF will be discussed on step 5.

Click here for the sql installation script for Club Site (original)
Click here for the sql installation script for Personal Web Site (updated)

In order to run the installation script, you need to have at least SQL client in your computer, or use web based sql manager.  You also need to know the remote sql server address, database name, user id and password. Please consult your host company to obtain this information.

Updated: If you don't have sql client you can use this web based sql server manager. Login and select the correct database, copy and paste and sql script above and run the query. You should be able to browse the new tables you just created.

Note: the installation script works for SQL Server 2000 & 2005, NOT for SQL Server 7. Some host company such as GoDaddy.com don't allow remote connection. You have to use the sql analyzer they provide.

Step 3 - Configure sql server connection in web.config file

By default, ClubSiteDB for Club Site, Personal for Personal Web Site. Remove any thing connectionString in your web.config file that point to sql server express. Copy and paste following code and replace with your updated sql server address, database name, username and password. Your host company should provide you this information.

<connectionStrings>
<add name="ClubSiteDB" connectionString="Data Source=sql server address;Initial Catalog=DB_xxxxx;Persist Security Info=True;UID=UserName;PWD=PassWord" providerName="System.Data.SqlClient" />
</
connectionStrings>


Encrypt your connection string is highly recommend.

Step 4 - Configure membership and rolemanager in web.config file

Comment out these two lines that ship with the starter kit in web.config file.
<!-- <roleManager enabled="true"/> -->

<!--<membership defaultProvider="AspNetSqlMembershipProvider"/>
-->

Copy and paste following code instead. Make sure having the "connectionStringName" match the connection string name you just added.



<
membership>
<
providers>
<
remove name="AspNetSqlMembershipProvider" />
<
add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
"
connectionStringName="ClubSiteDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</
providers>
</
membership>
<
profile>
<
providers>
<
remove name="AspNetSqlProfileProvider" />
<
add name="AspNetSqlProfileProvider"
connectionStringName
="ClubSiteDB"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
" />
</
providers>
</
profile>
<
roleManager enabled="true">
<
providers>
<
remove name="AspNetSqlRoleProvider" />
<
add name="AspNetSqlRoleProvider"
connectionStringName
="ClubSiteDB"
applicationName="/"
type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
" />
</
providers>
</
roleManager>

Step 5 - Preconfigured SQL Server Providers

Run aspnet_regsql.exe from this location
C:\WINDOWS\Microsoft.NET\Framework\<versionNumber>\aspnet_regsql.exe

Enter your remote sql server address, user name, password and database name as prompt.

Step 6 - update dbo - optional step for club site only

Update dbo (database owner) at the following files and anywhere you see dbo prefix is used. Replace "dbo" with username of sql database OR delete all the dbo prefix.

\default.aspx
\locations_view.aspx
\news_view.aspx
\app_code\DataSet.xsd

Before delete/update dbo prefix in default.aspx look like this:



<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"
SelectCommand="SELECT top 5 dbo.Events.id, dbo.Events.starttime, dbo.events.endtime, dbo.Events.title, dbo.Locations.title AS locationname FROM dbo.Events LEFT OUTER JOIN dbo.Locations ON dbo.Events.location = dbo.Locations.id WHERE (dbo.Events.starttime > GETDATE()) ORDER BY dbo.Events.starttime, dbo.events.id ">
</asp:SqlDataSource>

If you delete dbo prefix default.aspx should look like this:


<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"
SelectCommand="SELECT top 5 Events.id, Events.starttime, events.endtime, Events.title, Locations.title AS locationname FROM Events LEFT OUTER JOIN Locations ON Events.location = Locations.id WHERE (Events.starttime > GETDATE()) ORDER BY Events.starttime, events.id ">
</asp:SqlDataSource>


Step 7 User management through Visual Studio (Updated)

Now your site should be up and running. You want to assign yourself as administrator. You also want your friend register on your site to see your non public photos.Here is how you do it through the new "ASP.NET Configuration" feature in Visual Studio:

Click on "WebSite" on tool bar, go to "ASP.NET Configuration"




Click on "Security" you will see this window. Then follow the screen instruction to create users, roles as you wish!




Also, this video will help you getting familiar with user management:


Step 8: Onlien user management module

The starter kit doesn't come with online base user management and you have to write your own. I developed this module to share with you hope you find it helpful. Firstly I release the Access+C# version. In order to make the code simple, I use inline SQL statement. I recommend you change it back to Stored Procedure.

Under /App_Code add a class name it UserManager.cs and another class name users.cs

Under /Admin folder add an admin page name it UserAdmin.aspx, link this page to your admin panel.

Click here to download the source code.

Notes: Please don't forget to add your site to Starter Kits Club!


Back to the top

Add comment
*Name:
Website:
*Comments:

Due to the amount of spam, new posts are subject for approval.


Back to the top
Comments
11/02/2007 by evick
Good Evening Everybody

After Following the instructions, I keep having problems to run the personal web site of the Starter Kit.

The web hosting is Network Solutions and I use MS Enterprise Manager Console to administer the Database.

But I Still get this error









---And This One









If Anyone have an Idea of a way that this can be put it to run is going to be very appreciated.

Thanks for your Help
evick

10/29/2007 by Ray Bettoni
I wish I had seen this post 2 months ago. I eventually figured it out but it took a wile. Also the first web host (Godaddy) did not alow remote connections and things did not work right. Now I am with mysite4life and not only do they allow remote connections, they have starter kits that you can download to your site. It comes with a SQL database but you have to pay extra for more then 1 database.


01/03/2007 by Jessie
I am using godaddy.com as my website host. Remote connection to SQL server is not possible.

How can I grand admin rights so that I can administor my site? The site is runing after I ran the SQL installation script. But I can't perform administration even I created an admin user in the database.

I would appreciate any help.

Thanks!

JCC

12/18/2006 by Clint
I'm working through your instructions, however, I'm stuck at this error. Do you have any idea what could be causing this?

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized element 'membership'.

Source Error:


Line 19:
Line 20:
Line 21:
Line 22:
Line 23:


Source File: C:\Inetpub\wwwroot\clintlyon.com\web.config Line: 21

Here is my web.config file:




providerName="System.Data.SqlClient" />


















type="System.Web.Security.SqlMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="clintlyon"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />




connectionStringName="clintlyon"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />





connectionStringName="clintlyon"
applicationName="/"
type="System.Web.Security.SqlRoleProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />





description="SiteMap provider which reads in .sitemap XML files."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="web.sitemap"
securityTrimmingEnabled="true"/>














12/15/2006 by Andrew
Thanks SOOOOOO MUCH, after months of fighting with this thing, I found your site and it now works! You are a demi god! :-)

12/02/2006 by David
Thank you very much, your article help me a great deal.

11/03/2006 by Francesco
Hello, I'm try to study the asp.net language for my personal use. So, I have a free test web space, thank to microsoft and ARUBA ( italian host provider ) for 3 months. I followed the provider's instructions to begin with ClubWebSite. Then I followed the instructions above and I have a little problem. I haven't the remote connection for the DB but only a web inteface ( ugly ), so I can't go after step 6. Adn now, if you go in my web site and try to login ( whichever thing you write ) the answer is the same : Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Please, help me to understand the problem...I'm becoming crazy...P.S. This error after step 8 : The files '/App_Code/RolloverButtons.vb' and '/App_Code/Users.cs' use a different language, which is not allowed since they need to be compiled together.

10/22/2006 by Chris Cimino
Hi Sue,

Trying to implement the clubsite and your directions were wonderful. I do have one problem however. I established the Administrators group and setup a user and assigned to the Administrators group. However, when attempting to log in, it won't...it just refreshes (posts back) to the login page without an error.

Any ideas?

Thanks,
Chris
Knoxville, TN


10/22/2006 by Chris Cimino
Hi Sue,

Trying to implement the clubsite and your directions were wonderful. I do have one problem however. I established the Administrators group and setup a user and assigned to the Administrators group. However, when attempting to log in, it won't...it just refreshes (posts back) to the login page without an error.

Any ideas?

Thanks,
Chris
Knoxville, TN


10/04/2006 by Kevin
Hi Sue,

I have my website developed using Visual Studio 2005 and using the club.mdf database in my sql server 2005.

This is my first time to ever go hosting a website. I was looking around at host companies but my main concern is: How difficult is it to upload my database from sql server 2005 etc?

Thanks so much for your help. It will be hugely appreciated and I'll be sure to let people know od this article!

P.S. Which web hosting company would you recommend??

09/24/2006 by hcengiz
Hi Sue,
I have problem here:
Step 8: Onlien user management module

I copied your source codes to related folders and installed FreeTextBox.dll to my bin folder. Then I receive this:

Compiler Error Message: CS0246: The type or namespace name 'BasePage' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 12:
Line 13: public partial class UserAdmin_aspx : BasePage {
Line 14:
Line 15: }

What could be the problem?
Thanks much!
I loved this blog. It solved 90% of my problem. :)


09/19/2006 by Ken
Hi Sue
I have followed your steps in "Deploy starter kit to remote host" and all runs almost fine.
I run into an issue when I try to update the aspnet.membership or Memberinfo tables. Just trying these 2.

Using club starter kit sql2005 on a remote host Using a gridview with update, my app pulls the data and shows it, when I select edit, it will allow me to edit a field, but then when I say update, I get an error.
Have had this issue for a week now and been trying to resolve.
I have removed all dbo. references as per your instructions.
Can U make any other suggestions?
Thanks in advance...
Ken


09/16/2006 by Val
Sue, thanks a bunch!!! All my respects, you got me out of trouble !!!!

09/13/2006 by David
Sue
my first post here, but having followed all your instructions my wedb site is now up and running with all admin tables installed in my main database. The website is working and family can register on the site.
I gather you cannot use the website admin tool on a remote database (unless you know better of course!) So how can I do all the operations I would do on that tool locally? i.e. add roles, add application items etc.

Hope you can help
Regards
David, Derby, UK

09/12/2006 by Nigel
I am really struggling to deploy my Personal SK I have followed all your steps and still get errors. The latest being "This error can be caused by a virtual directory not being configured as an application in IIS".What does this mean and how can I rectify it. By the way I really like what you have done with your site and thanks for all the effort you put in to help novices like myself to learn.
Thanks-Nigel

09/06/2006 by Galen
Sue,

Tutorial worked great. The downloadable source code for the UserAdmin is for the Personal Starter Kit.
Do you have one for the Club Starter Kit, or do you know of someone who has written one?

Thanks - Galen

09/04/2006 by Sabbir
Hi Sue
i have managed to upload the site and amy connection string works fine. but i cannot login to the admin panel. can u plz tell me what can be the problem??

08/31/2006 by Sue
Paggy,

Most host companies don't support SQL Express due to security and scalability reasons. You CAN'T use SQL Express unless your host specifically indicate so. If they do and someone else alerady used ASPNETDB account, the work around is combine your database and ASPNETDB into one database.

Sue

08/31/2006 by Paggy
Hi,

Can you just guide me in short how to upload a site with sqlexpress support.

I have read all details about sql2000/sql2005, but i have not found a single solution for uploading with sqlExpress Support.

Pl. provide a solution for this. I am intersted in web config file and connection string details.

Thanks

paggy

08/30/2006 by vince
Sue,

I tried to use your code for the user management (step 8) but it gave me errors because it is written in c#. Is there a way around this or do you have a vb equivalent?

08/22/2006 by Sue
Brad,

Comment out the connection string will work. but you have to remember point to the right DB each time. There are two ways I know can do it automatically. You can make you judgement which is easier for you.

Solution A) You can specify the machine name in machine.config file in both local and remote server (assume you have access privellege). Each time load
the connection string dynamically depends where you are (local or remote).

Solution B) Usually we don't have access to machine.config file in a pay host so above solution won't help. Here is an example how I did for dynamic SMTP server. It loads the correct SMTP server depends on where the web site runs(local "127.0.0.1", remote "localhost" or IP address, I don't need this if I turn on my local
SMTP server)

MailAddress fromAddress = new MailAddress("webmaster@edream.org", "Edream Webmaster");
if (HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] == "127.0.0.1" || HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] == "localhost")
{
smtpClient.Host = "smtp-server.nc.rr.com";
}
else
{
smtpClient.Host = "localhost";
}


08/22/2006 by Brad
Sue,

Thanks for the reply.

So do you comment the remote connection string out when you test locally?

If I already have my site going locally with the popular forums extension installed but my local database is seperate, is there an easy way to combine these so that my local set up and remote will be the same?

08/22/2006 by Sue
Brad,

Depends on the connection string in your web.config file. If only remote database specified, you are connected to the remote database regardless when you run the site. In such case, your site doesn't work unless you have internet connection. Usually I have two connections specified in web.config file. One for local(testing), one for remote(production). It require more coding this way but will separate the testing and production database.

08/22/2006 by Brad
So Sue,

Then anytime that I run my site locally, I am actually connecting to the remote database?

08/17/2006 by Rashed
Hello this is greate work but i want to ask one thing .. is there any site to host my website and upload my personal.mdf file directly with out script

08/13/2006 by Gordon
I'm at a real stumbling block and need to get this fixed ASAP.

I've uploaded my club site files,
my DB is in SQL Server on the web host (webhost4life.com)... I ran aspnet_regsql.exe against my Club DB on my local computer and then loaded it into the SQL Server DB via a restore.

Now I need to load my membership with users. The default aspnet_users table is empty so I have no one to login to the website with. I load my website up remotely (http) though Visual Studio 2005 standard (first tried Visual Web Developer express) and I DO NOT have the Website/ASP.NET Configuration item on the menu ! How do I load my site with users?

A bit of background that may or may not have anything to do with this: I have done the DB merge and website upload from a different computer than the site was created with - laptop LCD screen broken. The laptop had Win XP PRO but the computer I'm using now only has Home Edition.

Again I'm combing the Internet looking for answers but am finding nothing. Need help to get this customers site up and running (my first VWD site)!

08/13/2006 by Adrian
I would like to use the Club Starter Kit with MS Access database, anyone did this before I'm new to ASP.NET.


08/10/2006 by Matt
Sue, I figured it out. If you have multiple starter kits sites on the same server, each has to have its own web site. They can be set up as virtuals, as it will cause the system to not see the correct css file. All is well now.

08/09/2006 by Matt
Question for you. Have the club starter kit and in VS2005 it works great. Created the admin user and when I view in browser, everything looks perfect. But, when I publish it to my web directory the login no longer works; the main title text is far left (no longer in the correct position); and the welcome text is now within the text below it.

Is this a database issue or am I missing something when publishing.

I am publishing to the same server I have the code on.

Thanks

07/11/2006 by xguru
Dear Sue, can you recommend a site/source code to
download to convert image storage to file system based? the c# version?

Appreciate it alot.

06/25/2006 by Sue
Prezemek,

Sorry for your trouble. Step 5 will generate ASPNET.mdf database for your project.  'dbo.aspnet_CheckSchemaVersion' stored procedure is in ASPNET database.   I am not sure about how to solve this problem with GoDaddy.com,  we have the same discussion on forum here http://forums.asp.net/thread/1295643.aspx (looking for the thread posted on May 31st 2006)

I think your choice will be A) contact your host see if they can help B) merge ASPNET.mdf and Personal.mdf  into one database.

With plan B your site should be up and running fine but you still find yourself won't be able to backup your database easily.

Sue

06/21/2006 by Przemek
Just to add. I'm getting this error when I try to create a user:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.



06/21/2006 by Przemek
Hi,

My host doesn't allow remote connections to my database so I've been having a hell of a time here.
What exaclty does step 5 do? How do I go about doing this without being able to run remotely? Is this something I can get the admins at my host to run?

Thanks


06/20/2006 by torkel
    do i have to set specials permissions to delete/rename fotoalbums?

br / torkel


06/16/2006 by christoph
    hej, it seams to be working, but i can not delet albums.. then i get this message... do you know, what it can be?

Server Error in ´/´ Application.




Runtime Error





Description: An
application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.

and here a good link to start the website administration tool without Visual Studio... but it is in german. => go to it





06/15/2006 by Sue
Christoph, Step 5 will give you another database which is ASPNETDB.MDF. Your membership information are stored in this database separately. Some people including will combine the two database into one. I am updating step 7, please check 10 minutes later.

06/15/2006 by christoph
Hej

i tried it with your discription and it doens't work... the login and register doesn't work... how can i add a user? on witch database do i have to add it? i only have 2 tables in the database and i have the App_data\personal.mdf database. maybe this one is not connected.

can somebody help me out?

regards

06/13/2006 by Sue

James, it's a good idea convert to file-based storage. In fact, most people already did with the same reason you have. What lanaguage you are using? For VB.NET, you can download the source code from http://www.jeremywadsworth.com/  or http://www.willyd.ca/CodeLibrary.aspx.



06/13/2006 by Sue
Albert, Thanks for the comment. This will certainly work only if you have Visual Studio in front of you. Let's say all you have just a brower for internet such as using a public computer in library, then you need a web-based admin interface to do the job. I am almost finish the user management interface and I don't mind to share source code with the community.

06/13/2006 by Albert
You don't have to use an SQL script to add yourself as a user, just run the site, register yourself, then go into the "Website" menu in Visual Web Developer, then select "ASP.NET Configuration" then click "Security" then "Manage Users". This will bring you a list of all the users, then you can edit yourself as a user and check the "Administrator" check box. This takes care of that. :)

06/06/2006 by James
Hello, My SQL provider has a limit of 50Meg for my SQL database. Due to the amount of photos I have, I am way over that limit. Is there a way of storing my photos in a seperate folder and then just having a link in the SQL file, instead?

Sorry if this is an obvious question, I am new to all this.

Regards, James.

06/05/2006 by christian
Hi cary.., :)
Sorry if i asked u here, not in forum, i,m a new comer in it programming, i need your help  how to import login table in sql express (aspnetdb.mdf) to sql server 2005 in my local dabase
Thanks a lot.., :) if u not mind please
send in my email please.. mangiwac@inco.com or christian_mangiwa@yahoo.com the answered..

regards,
Chris


05/31/2006 by Sue

Tony, 
Copy and paste the personal-add.sql script to GoDaddy's sql tool in control panel, and run it. You will get all the table and stored procedures for the web site.

I am not expert on GoDaddy's host package. You need to consult with them. Since they don't support remote connection I don't know if you can run aspnet_regsql.exe or not.
Sue



05/27/2006 by Tony.YangYang
Hi:
再补充一下:我是在本机的MS Visual Studio 2005中做的,也没有SQL Server,只有2005自带的SQL Server Express 2005,这样,我是不是也不能用aspnet_regsql.exe得到我自己的sql文件?


05/27/2006 by Tony.YangYang
Thanks! I have a question:
I would like to move my local personal starter kit to godaddy.com. I have added my own tables into this project and everything works well locally, but I wonder how I can get my own tables when I deploy to Godaddy just through running the personal-add.sql on Godaddy since I have never add scripts into personal-add.sql for my own tables, because I dont understand SQL script well.

Is there any other way to resolve my problem?

Thanks

我是中国人啦,在多伦多,英文烂,测试中文,呵呵,没有看懂我写的下次用中文写啦。谢谢!


05/24/2006 by Mauro
Thanks Sue,
now that's ok...

the problem was that my internet provider didn't have setted correct rights to the db folder. However your advise has helped me...

thx Mauro


05/22/2006 by Sue
Mauro, Try use physical path in web.config file. First you need to locate the path to "\mdb-database" folder. Your host company should has this information.

Instead of this


<add name="Personal" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Personal.mdb;" providerName="System.Data.OleDb"/>

Change it to


<add name="Personal" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\path-to-db-folder\mdb-database\Personal.mdb;" providerName="System.Data.OleDb"/>



Hope this helps. Sue

05/22/2006 by Mauro
Hello Sue,

I’m Mauro and i have a question for you…
I’ve created a web application with Personal Starter Kit for MS Access (by victor.corey). This application is adapted to use MS access database (ASPNETDB.mdb and personal.mdb). The problem is that personal starter kit use App_Data as default directory of database. But in my web hosting provider there is another default directory (called mdb-database), the only one that have write permission to ms access db. According to fact that I can’t modify (in ftp) the name of the folder and the application doesn’t work if I create another directory called App_Data, how can I modify the application in local mode to make mdb-database as the default directory of db???

Thanks a lot in advance,

Mauro




Back to the top