0
我想添加一個項目到combobox
,它已經在一些數據界限。在組合框中添加項目
代碼:
Public Sub showSection()
sb = New StringBuilder()
sb.Remove(0, sb.Length)
sb.Append("SELECT DISTINCT Section ")
sb.Append(" FROM Employee ")
sb.Append(" ORDER BY Section")
Dim sqlSection As String = sb.ToString()
da = New SqlDataAdapter(sqlSection, Conn)
da.Fill(ds, "Section")
dt = ds.Tables("Section")
bs.DataSource = dt
With cbSection
.DisplayMember = "Section"
.ValueMember = "Section"
.DataSource = ds.Tables("Section")
.DataBindings.Add("SelectedValue", bs, "Section")
End With
End Sub
但我想補充的項目,像"---All---"
,所以這應該是輸出。
---All---
HR
Store
Packing
Training
Qc
Qa
Stock