I'm working on a form with multiple combos boxed and one of them isn't working for me. The information is being pulled from one table in my database.
All other ones are working to find way more complex queries and it even depends on the results on the previous one, but this one is a stand-alone.
the idea is to look up the names of users in a database and display them and when selecting we use the user code (SQL):
select CashierCode, Name from cashier
results = 8011 users in the database
maybe the issue is with the number of users?
code goes as following:
Private Sub cmbUserScanned_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbUserScanned.SelectedIndexChanged
Try
Application.DoEvents()
'cmbUserScanned.Items.Clear()
Dim strSQL As String
Dim theList As DataTable
strSQL = "select CashierCode, Name from cashier"
SQL.WriteOutSQLToLogFile(strSQL)
theList = _SQL.GetDBDataTableSimple(strSQL)
If theList Is Nothing Then
WriteOutToLogFile("Found no operator in the cashier table")
Exit Sub
End If
cmbUserScanned.DataSource = theList
cmbUserScanned.DisplayMember = "Name"
cmbUserScanned.ValueMember = "CashierCode"
Catch ex As Exception
WriteOutToLogFile("Found no operator in the cashier table : " & ex.ToString)
End Try
End Sub