oshirowanen
oshirowanen

Reputation: 15925

Can't connect to remote database table

I have a desktop application which access a database in a lan environment which works find. However, the database has now been moved to a remote hosting company and I can access the database like so using query analyser:

select * from server_name.database_name.dbo.table_name

In the old lan environment, I was able to access the database like so using query analyser:

select * from database_name.dbo.table_name

The problem is, that my desktop application gives the following error when I change the sql within it to include the server_name:

System.Data.SqlClient.SqlException: Cannot find the object "table_name" because it does not exist or you do not have permissions.

Anyone know why this is happening. How do I go about giving the desktop app rights to the database, when it's using the same connection string as I use to connect to the database when using query analyser?

Upvotes: 0

Views: 174

Answers (1)

Pavlo Sobchuk
Pavlo Sobchuk

Reputation: 1564

Probably the problem is not in the access rights, but in the incorrect call to table. More chances that you just can't find the table you're trying to acces.

You should update your connection string to match changes related to database moving on remote server

Upvotes: 2

Related Questions