Solved

Error: The SELECT permission was denied on the object...

Posted on 2013-06-05
2
292 Views
Last Modified: 2013-07-17
Hi

I've had this problem before and I got around it by adding 'NT AUTHORITY / NETWORK SERVICE' as a Login then creating a user on the DB and mapped it to that login.  However, I'm now using SQL Server 2012 (Express) and I don't see a way of mapping a user to a login.  Anyway, by what I've been reading, it may just be a problem with the user in my connection string which is:
<add name="MyConnectionString" connectionString="Data Source=USER-PC\SQLEXPRESS;Initial Catalog=UKPR;Integrated Security=True"
   providerName="System.Data.SqlClient" />
When I run a query in SQL Server to find out who the owner of the DB I'm trying to access is, it says 'USER-PC/USER' so what is wrong and what else do I need to do to grant SELECT, UPDATE etc permissions on my DB??
0
Comment
Question by:Lorna70
2 Comments
 
LVL 19

Accepted Solution

by:
Rimvis earned 250 total points
ID: 39221744
Hi Lorna70,

Are you running ASP.NET web site? what is the IIS version?

You need to check under what user account application pool is running. If it's under ApplicationPoolIdentity, you might try this solution:
http://paigecsharp.blogspot.co.uk/2012/05/iis-application-pool-identity-access-to.html

BTW, I think it's a bad idea to give database access to Network Service account. You should use dedicated account for that.
0
 

Author Comment

by:Lorna70
ID: 39222154
Thanks - yes it's an ASP.Net website - I'm using Web Developer 2010 Express on a Windows 7 (not server) pc so I didn't think I needed to go near IIS (I hate IIS as it's really different now and I can't find anything). Will look at your link though and see if I can solve this.  Also, I have several other websites on my pc which are connected no problem to the Databases and I didn't have to change anything in IIS - this is why I think it is a SQL Server login/user issue.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question