[RESOLVED] Passing data from excel to access
Hello everyone,
I know how to read from excel..and how to insert into access database.
But it just doesnt work that easy for me.
I have some 10 columns in the excel sheet...
and I have 5 columns in the access database.
I want to just insert certain selected 5 columns into the access database...
Please help me with this someone..
Thanks
Re: Passing data from excel to access
I have a really really long code Ive tried...Its using the oledbreader,command,etc...I retrieved the data into a hashtable and tried inserting into access db.But,well it fails very very horribly.Please help me,Thanks. :)
Re: Passing data from excel to access
You can just use ADO.NET. One OleDbDataAdapter and two OleDbConnections. The SelectCommand has a connection to Excel and the InsertCommand has a connection to Access. Set the AcceptChangesDuringFill property of the adapter to False. Write you SQL to retrieve and then insert the data, then call Fill to populate a DataTable and Update to save it to Access.
Re: Passing data from excel to access
Thanks Jm,
Thats Exactly what I did and it gave me errors..It was because of my careless programming...
Thanks :)
Re: [RESOLVED] Passing data from excel to access
Forgot to mark this as resolved..Did it now :)