Sub ding()
Dim cmd As New SqlCommand("select DISTINCT babpim_ad from AD", cn)
Dim adapter As New SqlDataAdapter(cmd)
Dim table As New DataTable()
adapter.Fill(table)
ComboBox1.DataSource = table
ComboBox1.DisplayMember = "adid"
ComboBox1.ValueMember = "babpim_ad"
End Sub
Sub ding()
Dim cmd As New SqlCommand("select DISTINCT babpim_ad,adid from AD", cn) //ใส่ adid เข้ามาเพื่อนำไปใช้งาน
Dim adapter As New SqlDataAdapter(cmd)
Dim table As New DataTable()
adapter.Fill(table)
ComboBox1.DataSource = table
ComboBox1.DisplayMember = "babpim_ad"
ComboBox1.ValueMember = "adid"
End Sub