title: How should I load all the data from a column to a datagridview combobox?
body: <p>How can I make that the datagridview combobox loads with the items listed in the 'userid' column in my database? I want all the items to be listed on the datagridview combobox from the 'userid' column.</p>
  
  <p>Here are the lines I've written so far:</p>
  
  <pre><code>Private Sub check()
      cmd = New SqlCommand("Select UserID from info", con)
      da = New SqlDataAdapter(cmd)
      dt = New DataTable()
      da.Fill(dt)
      If dt.Rows.Count &gt; 0 Then
          ComboBox1.DataSource = dt
          ComboBox1.DisplayMember = "UserID"
          Dim dgvcolumn As New DataGridViewComboBoxColumn
          With dgvcolumn
              .Width = 150
              .Items.Add(ComboBox1.Items)
              .DataPropertyName = "UserID"
              .HeaderText = "UserID"
          End With
      Else
      End If
  End Sub
  </code></pre>