title: Call stored procedure with multiple parameters
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6201734/c-sharp-stored-procedure-with-parameters">C# stored procedure with parameters</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to call a stored procedure from c# passing in multiple parameters and can't to get it working. Here is what I have so far. </p>
  
  <pre><code>cmd = new SqlCommand();
  cmd = dbConn.CreateCommand();
  cmd.CommandText = "inserttoTable @size = " + size + ", @brand = " + brand + ", @manu = " + manu + ", @t= " + id.ToString();
  cmd.ExecuteNonQuery();
  </code></pre>
  
  <p>Size, brand and manu are all strings. inserttoTable is the stored procedure. </p>
  
  <p>I get the following error : <code>System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'TO'.</code></p>