This is going to be more specific to your web host than to asp.net in general. Deploying a database is no easy task. There are a few different approaches, again this largly depends on your web host. You should look through their knowledge base to see what
they recommend. The way I do it, is to first detach the DB from my project. Then I open it in MS SQL Server Management Studio. I create a backup of the database.(a .bak file) Then I create a new SQL Server DB on my hosted account. I then "restore" the DB
using the .bak file. You are going to have to get the correct Connection String fromyour web host.
Hope it helps!
Doers get what they want! Everyone else gets what they get.
Anyway, the main question is what database are you using: according with one of the tutorials, "If you're using SQL Server Compact as your database, the data is stored in an
.sdf file. When you publish the database, WebMatrix copies not only the
.sdf file but also the database program itself to the web server".
Else, if you are using SQL Server Express you must edit your connection string in web.config.
If you publish your site with Web Deploy and the .sdf file selected in the publish preview (look at the second of the links I suggested to you), it should work.
wavemaster
Participant
1351 Points
1162 Posts
website uploaded: what extra steps am I expected to take?
Aug 18, 2012 12:57 AM|LINK
Got my site uploaded and although I can browse the site, none of the interactions with the database work.
Is there something I need to do to make this work?
remojr76
Participant
902 Points
303 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 02:19 AM|LINK
Did you deploy the DB?
wavemaster
Participant
1351 Points
1162 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 02:27 AM|LINK
remojr76
Participant
902 Points
303 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 03:09 AM|LINK
This is going to be more specific to your web host than to asp.net in general. Deploying a database is no easy task. There are a few different approaches, again this largly depends on your web host. You should look through their knowledge base to see what they recommend. The way I do it, is to first detach the DB from my project. Then I open it in MS SQL Server Management Studio. I create a backup of the database.(a .bak file) Then I create a new SQL Server DB on my hosted account. I then "restore" the DB using the .bak file. You are going to have to get the correct Connection String fromyour web host.
Hope it helps!
wavemaster
Participant
1351 Points
1162 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 08:45 AM|LINK
I have posted a similar question on their forum.
Unfortunately, I am the first one posting on their Webmatrix forum, ever.
There must be some official Microsoft document that provides instructions on how to do this, right?
Thanks
GmGregori
Contributor
5564 Points
749 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 09:34 AM|LINK
Two tutorials that explain the publishing procedure are:
Introducing ASP.NET Web Pages 2 - Publishing a Site by Using WebMatrix
How to publish a web application using WebMatrix
Anyway, the main question is what database are you using: according with one of the tutorials, "If you're using SQL Server Compact as your database, the data is stored in an .sdf file. When you publish the database, WebMatrix copies not only the .sdf file but also the database program itself to the web server".
Else, if you are using SQL Server Express you must edit your connection string in web.config.
wavemaster
Participant
1351 Points
1162 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 12:08 PM|LINK
GmGregori
Contributor
5564 Points
749 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 12:12 PM|LINK
Look in your App_Data directory; if there is a file with .sdf extension, you are using a Sql CE database.
wavemaster
Participant
1351 Points
1162 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 01:34 PM|LINK
GmGregori
Contributor
5564 Points
749 Posts
Re: website uploaded: what extra steps am I expected to take?
Aug 18, 2012 02:48 PM|LINK
Yes.
If you publish your site with Web Deploy and the .sdf file selected in the publish preview (look at the second of the links I suggested to you), it should work.