title: Multiple where clauses SQL Server
body: <p>I'm writing this query to check for duplicates, but can't get multiple wheres to work. Syntax error near "," is what I get.</p>
  
  <pre><code>private static bool duplicate(Dictionary&lt;TableKey, string&gt; entry)
      {
          SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
          // TODO: Make changes to this command when new additions/modifications to the DB structure occur  
          string commandText = @"Select Barcode, FullName, Location, Notes, Category From Inventory " +
                               @"Where Barcode = @barcode, FullName = @fullname, Location = @location, " +
                               @"Notes = @notes, Category = @category";
  
          SqlCommand command = new SqlCommand(commandText, connection);
  
          command.Parameters.AddWithValue("@barcode", entry[TableKey.Barcode]);
          command.Parameters.AddWithValue("@fullname", entry[TableKey.FullName]);
          command.Parameters.AddWithValue("@location", entry[TableKey.Location]);
          command.Parameters.AddWithValue("@notes", entry[TableKey.Notes]);
          command.Parameters.AddWithValue("@category", entry[TableKey.Category]);
  
          command.Connection.Open();
          SqlDataReader reader = command.ExecuteReader();
  
          if (reader.HasRows)
              return true;
          else
              return false;
      }
  </code></pre>
  
  <p>This is my problem: </p>
  
  <pre><code>@"Where Barcode = @barcode, FullName = @fullname, Location = @location, " +
                               @"Notes = @notes, Category = @category";
  </code></pre>
  
  <p>How do I have multiple wheres? I've tried "and" and "AND"</p>