title: pass selected dropdownlist value to where clause
body: <p>I am inserting into a table by using the newxt query, but I dont know what the syntax is for telling the query I need to insert where training_id = &amp;dateSelected&amp; , the query below works by using a static value to test (2) . </p>
  
  <p>Please help.  </p>
  
  <pre><code>private void InsertInfo()
      {
          var dateSelected = dpDate.SelectedItem.Value;
          SqlConnection conn = new SqlConnection(GetConnectionString());
  
      string sql =    "INSERT INTO personTraining (name,training_id, training,trainingDate,trainingHour, trainingSession)SELECT @Val1,training_id,training,trainingDate,trainingHour,trainingSession FROM tbl_training WHERE  training_id = 2";
  </code></pre>