Search code examples
asp.net-mvc-3web-configsql-server-2008-express

Getting a ASP .NET MVC database working on a non-development machine?


This may be a basic question but I'm not very proficient in SQL Server.

I am Using Visual Studio 2008 Professional.

In a ASP .NET MVC 3 project I created a database that resides in 'App_Data'.

The web.config file uses this as the connectionString (partial):

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;

When I copy the project to a the production server the initial MVC logon page appears ok. When I entire in the login username/password I get a

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance

error message.

The SQL Server Express 2008 instance on the production system is set use 'Local System' for authentication.

I think that I'm not configuring SQL Express or my web.config correctly?

UPDATE1

Most of the links found on the internet talk about deleting a folder. In my scenario there is no 'C:\Documents and Settings\YOUR_USERNAME\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS' folder.

My solution for now (after much ASP .NET/IIS/SQL SErver security review) was to set "User Instance=True" to "User Instance=False" in the production web.config file.


Solution

  • Per your connection string, you're using Windows security to control access to the database. Does the account under which your web server runs have sufficient permissions on your database?

    You may wish to test using SQL Server security, just to confirm this is the problem. (Assuming SQL Server was installed with SQL Sercurity enabled.)