title: ASP.NET project with INSERT AND INNER JOIN queries
body: <p>I need to make a project in ASP.NET that, among other functions will be able to add new data to two tables at once.</p>
  <ul>
  <li><p>One table is named 'products' with columns 'name' and 'id' as PK</p>
  </li>
  <li><p>The other one is named 'auctions' with columns 'bidValue' and
  'productId'.</p>
  </li>
  </ul>
  <p>If someone could tell me what am I doing wrong in this code. When I click the button it gives an error page with this text:</p>
  <blockquote>
  <p>Incorrect syntax near ','.</p>
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  <p>Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near ','.</p>
  <p>Source Error:</p>
  </blockquote>
  <pre><code>Line 86: comm.Parameters.AddWithValue(&quot;@valueOfBid1&quot;,  valueOfBid);
  Line 87: 
  Line 88:                     ***comm.ExecuteNonQuery();***
  Line 89:                 }
  Line 90:             }
  </code></pre>
  <p>Here is my code:</p>
  <pre><code> public void makeBid(string nameOfProduct, int valueOfBid)
      {
          string query = @&quot;INSERT INTO products.name, auctions.bidValue VALUES @nameOfProduc,
                         @valueOfBid1
                         FROM products 
                         INNER JOIN auctions ON products.id = auctions.productId&quot;;
          using (SqlConnection conn = DbBroker.conn())
          {
              using (SqlCommand comm = new SqlCommand(query, conn))
              {
                  comm.Parameters.AddWithValue(&quot;@nameOfProduc&quot;, nameOfProduct);
                  comm.Parameters.AddWithValue(&quot;@valueOfBid1&quot;, valueOfBid);
  
                  comm.ExecuteNonQuery();
              }
          }
        
      }
  
   protected void Button1_Click(object sender, EventArgs e)
      {
          Auction1 newBid = new Auction1();
          string productName = TextBox1.Text.Trim().ToString();
          string lbItem = ListBox1.SelectedValue;
          int bidValue = Int32.Parse(lbItem);
          newBid.makeBid(productName, bidValue);
      }
  </code></pre>