Add Reference to Microsoft Access 14.0 Object
Add Reference based on Version of Access you are Using I am using Access 2010
string file = Application.StartupPath + @"\excel.xlsx";
DataSet ds = ImportExcelXLS(file, true);
ds.WriteXml(Application.StartupPath + @"\test.xml", XmlWriteMode.WriteSchema);
access.Application _accessData;
_accessData = new access.Application();
_accessData.Visible = false;
_accessData.OpenCurrentDatabase(Application.StartupPath + @"\test.accdb");
_accessData.ImportXML(Application.StartupPath + @"\test.xml", access.AcImportXMLOption.acStructureAndData);
_accessData.CloseCurrentDatabase();
_accessData.Quit(Microsoft.Office.Interop.Access.AcQuitOption.acQuitSaveAll);
_accessData = null;
for Method ImportExcelXLS(file, true);
Please check my previous post for loading Excel Data DataSet.