title: Invalid object name 'Users' when reading from Users table
body: <p>I'm building a registration page and one of the things I need to do is to check if the supplied email already exists. Here's my code for that:</p>
  
  <pre><code>// Check if email already exists in the database
  cn.Open();
  SqlCommand Command = new SqlCommand("SELECT Email FROM Users WHERE Email = @Email", cn);
  Command.Parameters.Add("@Email", SqlDbType.NVarChar).Value = _Email;
  
  SqlDataReader Reader = Command.ExecuteReader(CommandBehavior.CloseConnection);
  Reader.Read();
  if (Reader.HasRows)
  {
      // Email already exists
      Reader.Close();
      Feedback.Text = "That email is already in use, please use another";
  }
  else
  {
      // Doesn't exist, proceed
  }
  </code></pre>
  
  <p>When this code is run, I get the following exception which is fired on the <code>COmmand.ExecuteReader()</code> line:</p>
  
  <p><code>System.Data.SqlClient.SqlException: Invalid object name 'Users'.</code></p>
  
  <p>From what I know, it means it can't find the Users table. It's definitely there, I just created it and I can see it under the Server Explorer window:</p>
  
  <p><img src="https://i.stack.imgur.com/YRWjX.png" alt="Screenshot"></p>
  
  <p>Also, within my connection string I have <code>Initial Catalog=db_74;</code> so it's using the correct database.</p>
  
  <p>So, I'm at a loss as to what could be going wrong. Any ideas?</p>