title: how to retrieve multiple columns from two tables in C#, using SQL?
body: <p>I have two tables and need to retrieve some columns from both tables based on the common key which is ProductID. I tried the following but got an error &quot;Incorrect syntax near the keyword 'JOIN'&quot;</p>
  <pre><code>string selectProductStatement = 
  &quot;SELECT Products.Code, Products.Description,&quot;+
  &quot;Products.Category, Products.Price, BookProducts.Author&quot;+
  &quot;FROM Products&quot;+
  &quot;INNER JOIN BookProducts ON (Products.@ProductID = BookProducts.ProductID)&quot;;
  
  SqlCommand comm = new SqlCommand(selectProductStatement, connection);
  comm.Parameters.AddWithValue(&quot;@productID&quot;, productID);
  </code></pre>
  <p>the tables are:</p>
  <h1>Products</h1>
  <pre><code>  ProductID
    Code
    Description
    Category
    Price
  </code></pre>
  <h1>BookProducts</h1>
  <pre><code>  BookID PK
    ProductID FK
    Author
  </code></pre>