title: Cannot find the object because it does not exist
body: <p>I did spend an hour searching before I posted about this problem.</p>
  
  <p>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:</p>
  
  <pre><code>Cannot find the object "Products" because it does not exist or you do not have permissions
  </code></pre>
  
  <p>Why does this error occur and what should I do to resolve it?</p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>I tried specifying <code>dbo.Products</code> and before executing I also tried <code>use dbname</code> but that did not help.</p>