Click here to Skip to main content
15,921,531 members

Comments by Member 11768334 (Top 2 by date)

Member 11768334 30-Jun-15 21:20pm View    
how can I fix that error for my codes to be able to work?
Member 11768334 15-Jun-15 22:15pm View    
the only table that is showing in the data grid view was the grave-night. why is that? I only input the items in the combobox it is not connected to my access database is that ok?

here is my code



MyConn = New OleDBConnection
MyConn.ConnectionString = connString
ds = New DataSet
tables = ds.Tables

If Combobox1.text = "day-morning" Then
da = New OleDBDataAdapter("Select * FROM [day-morning]", MyConn)
da.Fills(ds,"day-morning")
Dim view As New DataView(tables(0))
source1.datasource = view
DataGridView1.DataSource = view
ElseIf Combobox1.text = "swing-afternoon" Then
da = New OleDBDataAdapter("Select * FROM [swing-afternoon]", MyConn)
da.Fills(ds,"swing-afternoon")
Dim view As New DataView(tables(0))
source1.datasource = view
DataGridView1.DataSource = view
else : Combobox1.text = "grave-night"
da = New OleDBDataAdapter("Select * FROM [grave-night]", MyConn)
da.Fills(ds,"grave-night")
Dim view As New DataView(tables(0))
source1.datasource = view
DataGridView1.DataSource = view
end if