I have an excel sheet with 2 tables both wit 6 columns an each starts at columnB
Table1 with headers starts at B16:G16 AND ENDS AT B62:G62.
Table2 with headers starts at B91:G91 AND ENDS AT B118:G118.
I want to load table1 to Datagridview1 and table2 to Datagridview2
Please help
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Users\korisnik\Desktop\" & File.Text & "';Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select Sifra , Amount from [Ispis$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Net-informations.com")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)