title: How to get checkedboxlist item Id from C# winform
body: <p>How i can get id when i click on item of checkedboxlist. Currently i am getting string name of the Item but i want to get id when i click on text item in checkedboxlist ?</p>
  <p><strong>Here is my code:</strong></p>
  <pre class="lang-cs prettyprint-override"><code>private void BindChackBox2()
  {
      try
      {
          SqlConnection con = new  SqlConnection(ConfigurationManager
              .ConnectionStrings[&quot;Conec&quot;].ConnectionString);
          SqlCommand cmd = new SqlCommand(&quot;SELECT Id, Task  FROM Mytodo_Task 
              Where Status='Ongoing' And Username='&quot; + Login.recuser + &quot;'&quot;, con);
          SqlDataAdapter sda = new SqlDataAdapter(cmd);
          DataTable dt = new DataTable();
          sda.Fill(dt);
  
          for (int i = 0; i &lt; dt.Rows.Count; i++)
          {
              checkedListBoxongoing.Items.Add(dt.Rows[i][&quot;Task&quot;].ToString() +&quot; &quot;+ dt.Rows[i];
              [&quot;Id&quot;].ToString());
          }
      }
      catch { }
  }
  </code></pre>