Question: how to export data from excel to datatable in c#?
Answer: public static DataTable ConvertExcelToDataTable(string FileName) { DataTable dtResult = null; int totalSheet = 0; //No of sheets on excel file. using(OleDbConnection objConn = new OleDbConnection(@ "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FileName + ";Extended Properties='Excel 12.0;HDR=YES;IMEX=1;';")) {