i deployed asp.net web api on local iis (7.0) , can't through in accessing database.
when identity (under process model) set localsystem
, api return exception:
invalid object name 'dbo.tablename'
if set identity applicationpoolidentity
, api return exception:
cannot open database "dbname" requested login. login failed. login failed user 'iis apppool\asp.net v4.0'.
solutions tried:
added permissions both folder , .mdf file 'asp.net v4.0'
other relevant information:
connection string (in web.config
)
<add name="dbcontext" connectionstring="data source=(localdb)\v11.0;initial catalog=[dbname];trusted_connection=yes;" providername="system.data.sqlclient" />
i tried running application using visual studio using iis express, worked fine.
it says have 3 options,
- run iis id (bad idea),
- run localdb shared instance, or
- use sql express
the latter best advice.
Comments
Post a Comment