I did spend an hour searching before I posted about this problem.
The table does exist and I can query that table and I can see the resultset but when i try to execute from Visual Studio 2008 I get the below error:
Cannot find the object "Products" because it does not exist or you do not have permissions
Why does this error occur and what should I do to resolve it?
using (System.Data.SqlClient.SqlCommand cmd = connection.CreateCommand() as System.Data.SqlClient.SqlCommand)
{
cmd.CommandText = "SET IDENTITY_INSERT Products ON";
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
I tried specifying dbo.Products
and before executing I also tried use dbname
but that did not help.