views:

809

answers:

2

I am starting to learn ASP.NET MVC.

I have deployed the "stock" ASP.NET MVC Sample Application (i.e. the simple user account system) to have a live version to test against when I start to play.

Note that I'm using: - ASP.NET MVC 1.0 release. - WebFusion Host.

I think the issue is to do with accessing the database.

I deployed using the following guide: http://msdn.microsoft.com/en-us/library/dd410407.aspx

Site url (so you can go see the error for yourself): http://holsee.ac.webfusion.co.uk/

The error exist when I try to log-in or register (anything DB related it seems).

I get the error message screen which states: "Sorry, an error occurred while processing your request."

Any advise from somebody who can spot the err in my ways or whats went wrong would be greatly appreshiated.

Edit: Exporting and Importing the Database

I think its a matter of not deploying the database correctly, I just deployed it within the App Data folder (as is when the application was created) and used the default connection string.

I am not sure how to Import the Database using my webhost which is webfusion.com. It requires me to export the my Database to a .sql file (know how this can be done?) then upload that file to create the DB on the server. At this point my host provides the connection string.

+3  A: 

Always start with the obvious...sounds like a database permissions error.

When you deployed, did you make sure the deployed database had the proper user permissions for your application's user credentials?

UPDATE:

To check this, follow these steps:

  1. Open the web.config file for you ASP.NET MVC application.

  2. Find the section of the config file. For the default ASP.NET MVC example, it looks like the following:

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

  3. This default connection string uses Integrated Authentication. Using Integrated Security on your deployed site can get tricky. The easiest way to take care of this is to create an sql account for your application to use. You then add that SQL user to your deployed database.

  4. Once you have your user created and added to the database, you need to update your connection string. Check out this resource for crafting your connection string:

http://www.connectionstrings.com

Justin Niessner
How do I "make sure the deployed database had the proper user permissions for your application's user credentials"?
StevenH
Thanks for the useful advise
StevenH
A: 

Hi Steven,

I see that your site is working now, can u tell us exactly how you changed the connectionString to make it work?

Thanks.