title: Visual C# SQL Server Northwind Database Error: Invalid Object Name 'dbo.Products'
body: <p>My issue is that I keep getting an error on console that says</p>
  
  <blockquote>
    <p>Invalid Object Name 'dbo.Products'</p>
  </blockquote>
  
  <p>I am using Visual C# 2008 Express Edition and SQL Server 2008 Express.</p>
  
  <p>I have had some issue with preparing/installing the <code>Northwind</code> sample database, so I'm unsure if that has any weight on the issue though. Our teacher gave a test program which is the program I am receiving this error.</p>
  
  <pre><code>static void Main()
  {
      string connectionString =
              "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Andrew\\Desktop\\SQL Server  2000 Sample Databases\\PUBS.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True";
  
      string queryString =
          "SELECT ProductID, UnitPrice, ProductName FROM dbo.Products "
              + "WHERE UnitPrice &gt; @pricePoint "
              + "ORDER BY UnitPrice DESC;";
  
      int paramValue = 5;
  
      using (SqlConnection connection = new SqlConnection(connectionString))
      {
          SqlCommand command = new SqlCommand(queryString, connection);
          command.Parameters.AddWithValue("@pricePoint", paramValue);
  
          try
          {
              connection.Open();
              SqlDataReader reader = command.ExecuteReader();
  
              while (reader.Read())
              {
                  Console.WriteLine("\t{0}\t{1}\t{2}",
                      reader[0], reader[1], reader[2]);
              }
  
              reader.Close();
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
          }
  
          Console.ReadLine();
      }
  }
  </code></pre>