Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Where are you trying to populate the <code>ComboBox</code>? The only interaction I see is here:</p> <pre><code>For i = 0 To dbTable.Rows.Count - 1 ComboBoxCard.ValueMember = "ccNumber" Next </code></pre> <p>Which I'm guessing isn't doing what you think it's doing. For one thing, you're setting <code>ValueMember</code> to the same value multiple times in a loop. Nothing in the statement changes with each iteration of the loop, so why loop it?</p> <p>More specifically, <code>ValueMember</code> isn't actually any kind of displayed value. <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listcontrol.valuemember.aspx" rel="nofollow">It's used to indicate which field in the bound data should contain the value</a>. This is used when you provide a <code>DataSource</code> for the control, which you're missing.</p> <p>I'll assume the <code>DataSource</code> should be <code>dbTable</code>, so you're probably looking to do something like this:</p> <pre><code>ComboBoxCard.DataSource = dbTable ComboBoxCard.ValueMember = "ccNumber" ComboBoxCard.DisplayMember = "Some Other Field in the database" </code></pre> <p>I don't remember if you need to explicitly call <code>.DataBind()</code> on the control after these statements, but the example I linked to doesn't do it so I'll leave it out.</p> <p>Essentially what you're <em>trying</em> to do in your code is loop through the results and add them to the <code>ComboBox</code>. You don't need to do this. The <code>ComboBox</code> is capable of doing this internally if you just point its <code>DataSource</code> to the set of data being used and tell it which fields it needs to use on that set. This is called <a href="http://msdn.microsoft.com/en-us/library/ms752347.aspx" rel="nofollow">data binding</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload