I need to import data into a DataGridView
but I need the data to stack after the last import. So, if my first file is 100 records, and my second file is 200 records I should now have 300 records. I need to be able to press an import button browse to a file and import it and it adds to the end of the data set. The amount of files and records will vary greatly. here is my code so far, but right now it just overwrites the data already in the DataGridView
each time I import new data. The excel file is just a test file, eventually ill add a folder browser dialog where I'll select "x" amount of files.
MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Work\4pc_test1.xlsx;Extended Properties=Excel 12.0;")
'MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & fd.FileName & "';Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Net-informations.com")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()