Last post Feb 28, 2020 09:27 AM by jiadongm
Feb 10, 2020 03:22 PMfirstname.lastname@example.org|LINK
i get this error when i want to run the app
TableDependency.SqlClient.Exceptions.UserWithNoPermissionException: 'User with no permission.'
Feb 10, 2020 05:55 PM|bruce (sqlwork.com)|LINK
the error is pretty clear, the appool account does not have permission to the database.
Feb 10, 2020 06:38 PMemail@example.com|LINK
what does you mean about appool account? can you explain it clearly?
Feb 10, 2020 06:44 PM|bruce (sqlwork.com)|LINK
when you create an asp.net virtual directory in IIS you specify an account for the app pool the site runs in. the default is a local account. this account will not have database access. if you are using trusted security, then the app pool account will need
to be a domain account with database access. IIS manager can be used to see the app pools assigned and the accounts.
note: when you run debug with IIS express, the app pool account is your login, so it has all the permission you do.
Feb 10, 2020 07:04 PMfirstname.lastname@example.org|LINK
but my project is not on iis its localhost
Feb 10, 2020 10:53 PM|bruce (sqlwork.com)|LINK
if you have permission, then check the connect string
Feb 11, 2020 05:34 AMemail@example.com|LINK
also the connection string is true
Feb 11, 2020 11:36 AM|SURYA_TECH|LINK
Open IIS manager (run command inetmgr)
Then select your application which is hosted in IIS, right click and select mange website -> Advanced Setting.
In the advanced setting check the physical path Credential.
Then a Pop window will open on name "connect as" in that window select "Specific User" then it will ask you give your user id and password.
Give the credential and click Ok, then restart IIS and run your application.
Hope it works for you.
Feb 11, 2020 12:58 PMfirstname.lastname@example.org|LINK
my project is not on iis is sqltabledependency work on localhost not on iis?
Feb 11, 2020 02:56 PM|l.laxmikant|LINK
The user which you are using in connection string should have db_owner permission on your database.
ALTER AUTHORIZATION ON DATABASE::MyDatabaseName TO NewOwner;
Feb 12, 2020 07:57 AMemail@example.com|LINK
also i have the same error
Feb 28, 2020 09:27 AM|jiadongm|LINK
From the document: In case the user specified in the connection string is not database Administrator, db owner or neither has db_owner role,
please make sure to GRANT the following permissions to your login user:
If you can't get enough permissions, you can chooes to skip the permissions test done by SqlTableDependency.