Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 19, 2012 05:40 PM by wavemaster
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?
Aug 18, 2012 02:19 AM|LINK
Did you deploy the DB?
Aug 18, 2012 02:27 AM|LINK
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!
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?
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.
Aug 18, 2012 12:08 PM|LINK
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.
Aug 18, 2012 01:34 PM|LINK
Aug 18, 2012 02:48 PM|LINK
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.