我想添加項目ComboBox
。我已成功添加項目,但ComboBox
已有重複項目。爲什麼?組合框顯示重複值
這是我的代碼:
Public Sub load_consigneecode()
Dim con As OleDbConnection = New OleDbConnection(constring)
con.Open()
Dim sql As String = "select con_code from TblConsignee order by con_code"
Dim cmd As New OleDbCommand(sql, con)
Dim myreader As OleDbDataReader = cmd.ExecuteReader()
While myreader.Read()
cmbCode.Items.Add(myreader(0).ToString)
End While
myreader.Close()
con.Close()
End Sub
這是結果:
在我的表:
我看到...功能開始之前,我們要清除的項目.. –