title: data insert an retrival to/from database using checked list box
body: <p>How to insert and retrieve data to/from database using checkedlistbox in <code>c#</code>
  here is my cod eon button click event :</p>
  
  <pre><code>string CS = ConfigurationManager.ConnectionStrings["RosterFinal"].ConnectionString;
          using (SqlConnection con = new SqlConnection(CS))
          {
              var Sep = "";
              string INSERTq = "insert into T_Entity values(@Tno,@Tname,@STime,@ETime,@Skill1,@S_Day1)";
              SqlCommand cmd = new SqlCommand(INSERTq, con);
              cmd.Parameters.AddWithValue("@Tno", txtTNo.Text);
              cmd.Parameters.AddWithValue("@Tname", txtTNa.Text);
              cmd.Parameters.AddWithValue("@STime", dateTimePicker1.Text);
              cmd.Parameters.AddWithValue("@ETime", dateTimePicker2.Text);
              foreach (object i in checkedListBox1.CheckedItems )
              {
                 // cmd.Parameters.Clear();
                  cmd.Parameters.AddWithValue("@Skill1", checkedListBox1.SelectedItem.ToString());                   
              }
              foreach (object m in cbDay.CheckedItems)
              {
                 // cmd.Parameters.Clear();
                  cmd.Parameters.AddWithValue("@S_Day1", cbDay.SelectedItem.ToString());
              }             
              con.Open();
              cmd.ExecuteNonQuery();
              cmd.Parameters.Clear();
          }
  </code></pre>
  
  <p>It is not readind the scaller parameters and givein exception that scaller parameters <code>skill1</code> must be unique</p>