Private Sub ProductMaster_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
LoadDataComboBox()
End Sub
Private Sub LoadDataComboBox()
Conn = New OleDbConnection(StrConnString)
DA = New OleDbDataAdapter("SELECT CustomerCode, CustomerShortName, CustomerName, Address FROM Customers ORDER BY CustomerShortName ", Conn)
Ds = New DataSet
DA.Fill(Ds, "Customer")
If Ds.Tables("Customer").Rows.Count <> 0 Then
With ComboBox1
.DataSource = Ds.Tables("Customer")
.DisplayMember = "CustomerShortName"
.ValueMember = "CustomerShortName"
.SelectedValue = "CustomerShortName"
End With
End If
End Sub
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As System.EventArgs) Handles ComboBox1.SelectedValueChanged
'LoadDataComboBox()
End Sub