0

I am executing a stored procedure in an asp.net application hosted in local IIS . I am using SQL LocalDB v11.0 for my database . Here is my connection string

connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=IntMonkey;MultipleActiveResultSets=True;"

When I run my code it gives error

Cannot open database "IntMonkey" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.

My application pool is set to DefaultAppPool . I tried to set identity to Network Service and Local System but same error for those users. I have created Logins for [IIS APPPOOL\DefaultAppPool] , [NT AUTHORITY\NETWORK SERVICE] , [IIS APPPOOL\ASP.NET v4.0] and assign User Mapping to this database with roles as db_owner , db_writer and db_reader but still not working. It works fine when running without IIS.

Need help what I am doing wrong ?

Ghazanfar Khan
  • 3,648
  • 8
  • 44
  • 89
  • have you directly tried to connect from sql management studio using these new logins? – TheVillageIdiot Jan 31 '16 at 00:23
  • Try this http://stackoverflow.com/questions/34981518/sqlexception-invalid-object-name-dbo-tablename-when-using-localsystem-as-iden – Liesel Jan 31 '16 at 00:29
  • Yes they are login successfully – Ghazanfar Khan Jan 31 '16 at 10:58
  • I tried Approach 2: Use LocalDB Shared Instance sqllocaldb share v11.0 IIS_DB run this and change my conn string to Data Source=(LocalDb)\v11.0.\IIS_DB;;Initial Catalog=IntMonkey;MultipleActiveResultSets=True; but now it gives Network Instance error . – Ghazanfar Khan Jan 31 '16 at 11:26

0 Answers0