C
christing
Guest
I am planning crate the dropdown button when user insert data on access database when run program will direct detect the database i insert on access database.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim CN As New OleDbConnection
CN.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=mydataX.mdb;"
Dim cmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter("select tbl_Reason order by DATA desc;", CN)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "table")
Me.ComboBox1.DataSource = ds.Tables("table").DefaultView
Me.ComboBox1.DisplayMember = "Reason"
Me.ComboBox1.ValueMember = "....."
CN.Close()
End Sub
Continue reading...
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim CN As New OleDbConnection
CN.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0; Data Source=mydataX.mdb;"
Dim cmd As New OleDb.OleDbCommand
Dim da As New OleDb.OleDbDataAdapter("select tbl_Reason order by DATA desc;", CN)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "table")
Me.ComboBox1.DataSource = ds.Tables("table").DefaultView
Me.ComboBox1.DisplayMember = "Reason"
Me.ComboBox1.ValueMember = "....."
CN.Close()
End Sub
Continue reading...