title: Set Default Checked Items in a CheckedLIstBox VB.Net
body: <p>I have a code that retrieve the data from SQL Server to a CheckedListBox</p>
  
  <pre><code>    Dim queryString As String = "SELECT Facility FROM Database.dbo.Facility"
      Dim connection As New SqlConnection(connectionString)
      Dim command As New SqlCommand(queryString, connection)
      connection.Open()
      Dim dataReader As SqlDataReader = command.ExecuteReader()
      Dim var As New DataTable
      Dim source As New BindingSource
      source.DataSource = dataReader
      CheckList_Facility.DataSource = source
      CheckList_Facility.ValueMember = "Facility"
      connection.Close()
  </code></pre>
  
  <p>The result works well, assume I have the result:</p>
  
  <pre><code>[ ]AA
  [ ]BB
  [ ]CC
  </code></pre>
  
  <p>I would like to check IF there is "BB" then it automatically checked "BB" so that </p>
  
  <pre><code>[ ]AA
  [X]BB
  [ ]CC
  </code></pre>
  
  <p>I tried but failed. Something likes</p>
  
  <pre><code>     For Each item In CheckedList_Facility.Items
          If (item("Facility").ToString() = "BBB") Then
              CheckedList_Region.SelectedValue = True
      Next
  </code></pre>
  
  <p>To try if it does actually return the string, I tested the code</p>
  
  <pre><code>For Each item In CheckedList_Facility.Items
      MsgBox(item("Facility").ToString())
  Next
  </code></pre>
  
  <p><strong>It does return "AA", "BB" , "CC"</strong></p>