I am new to both ASP.NET and SQL Server.
I have IIS8 installed on my Windows 8 PC, together with SQL Server Express 2012. Given my ignorance, I have just set everything up using default values.
I have a very small web site set up in its own folder and set up in IIS 8 as a virtual folder under the default web site. I have also set up a very simple database called 'StockControl' via SSMS, which contains one table called 'Colours' which has two columns.
One page in the website is a simple ASP.NET form which runs on localhost without any problems.
On the second page in the website I added a GridView ASP.NET control, letting Expression Web 4 generate the connection string and place it in a web.config file. I tested the SQL query and the connection as I went along and both came back as successful. So
far, so good.However, when I try to run the page in the browser I get the error message:
Server Error in '/' Application.
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:[SqlException (0x80131904): Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
|
I have spent two days trying to find out what I have done wrong and even uninstalled and re-installed SQL Server just in case i'd totally messed up and corrupted the database.
I would really appreciate some help please.