Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 SELECT permission denied

Author  Topic 

assafp
Starting Member

1 Post

Posted - 2009-09-02 : 12:18:41
Hi,
I developed a new section for an existing website, using Visual Web developer 2008.
1. I copied the existing website to my local machine and made sure that it works ok.
a. I also made a Local copy of the website database (SQL Server), including users with identical permissions.
2. Then I created my own folder and made all the development in there.
3. In some stage I needed to access the database, so I created a new dataset in a new App_Code directory (as such directory did not exist yet).
4. I created several table adapters with several queries, all by using the Visual Web Developer GUI.
5. Everything worked fine.

The problem appeared when I tried to copy my local work back to the original machine:
1. I copied to the original machine the new folder that contains the new pages I made and the App_Code new folder.
2. I made sure that the database users have the same names and same permission both in my local and the original databases
3. I changed the copied connection strings in the web.config file to include the database server address instead of my local computer name as the Data Source.

When I'm trying to run query from the dataset GUI of the Original computer (right-click one of the queries >> configure>>query builder>>execute query) I'm getting the following error message:

************************
SQL Execution Error.
Execute SQL Statement: SELECT …[the rest of my query]
Error Source: .NET SqlClient Data Provider
Error Message: SELECT permission denied on object '[myTableName]', database '[myDatabasename]', owner 'dbo'.

************************

Executing identical query from the enterprise manager works ok.
Ideas are more than welcome,

Thanks,
Assaf
   

- Advertisement -