Login failed for user 'IIS APPPOOL\DefaultAppPool' on SQL Express 2012
i new both asp.net , sql server.
i have iis8 installed on windows 8 pc, sql server express 2012. given ignorance, have set using default values.
i have small web site set in own folder , set in iis 8 virtual folder under default web site. have set simple database called 'stockcontrol' via ssms, contains 1 table called 'colours' has 2 columns.
one page in website simple asp.net form runs on localhost without problems.
on second page in website added gridview asp.net control, letting expression web 4 generate connection string , place in web.config file. tested sql query , connection went along , both came successful. far, good.however, when try run page in browser error message:
server error in '/' application.
cannot open user default database. login failed.
login failed user 'iis apppool\defaultapppool'.
description: an unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.data.sqlclient.sqlexception: cannot open user default database. login failed.
login failed user 'iis apppool\defaultapppool'. source error:
an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. |
stack trace:
|
i have spent 2 days trying find out have done wrong , uninstalled , re-installed sql server in case i'd totally messed , corrupted database.
i appreciate please.
that means database permanently attached sql instance, fine. connection string asking attach database, it's better on server if database attached time.
connect sql instance , verify database attached , replace
attachdbfilename="c:\program files\microsoft sql server\mssql11.sqlexpress\mssql\data\stockcontrol.mdf
with
database=stockcontrol
(assuming stockcontrol name of database).
david
david http://blogs.msdn.com/b/dbrowne/
SQL Server > Getting started with SQL Server
Comments
Post a Comment