My code here gets all the account numbers and then loads the combo box based on the usernames for the account numbers. However, some acct numbers a[[ear more than once in the database, therefore, they show up multiple times in the ddl, where they should
only show up once.
Public Sub GETUSERNAMES()
SqlUsrMaint.SelectCommand = "SELECT ACCTNUM, USERNAME" & _
" FROM FTPUsers WHERE ACCTNUM='" & ddlAcctNum.Text & "'"
Dim dv As DataView = CType(SqlUsrMaint.Select(DataSourceSelectArguments.Empty), DataView)
If dv.Count > 0 Then
Dim i As Integer = 0
Do Until i = dv.Count
Dim dr As DataRowView = dv.Item(i)
cbUserName.Text = dr.Item(1).ToString
i = i + 1
Loop
End If
End Sub
Go to the complete details ...