Unknown problem while exporting excel to System.DataTable
I am trying to get data from Excel File to DataTable. Here's my code-snippet : FilePath = WebConfig.SavePath + "Book2.xls"; // Create the connection object OleDbConnection oledbConn = new OleDbConnection(WebConfig.ExcelConnection(FilePath)); // Open connection oledbConn.Open(); // Create OleDbCommand object and select data from worksheet Sheet1 //WebConfig.SheetNameFirstExcel OleDbCommand cmd = new OleDbCommand("SELECT * FROM [" + "Sheet1" + "$]", oledbConn); // Create new OleDbDataAdapter OleDbDataAdapter oleda = new OleDbDataAdapter(); oleda.SelectCommand = cmd; // Create a DataSet which