Posted on: 4/28/2015 8:31:30 AM | Views : 761

Have used the following code to convert  a excel sheet into datatable.
I have getting this error while filling that 
"The Microsoft Access database engine could not find the object 'Sheet1'. Make sure the object exists and that you spell its name and the path name correctly. If 'Sheet1' is not a local object, check your network connection or contact the server administrator."
OleDbConnection cnn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath(@"~\Sample.xlsx") + "; Extended Properties=Excel 12.0;");
OleDbCommand oconn = new OleDbCommand("select * from [Sheet1]", cnn); cnn.Open(); OleDbDataAdapter adp = new OleDbDataAdapter(oconn); DataTable dt = new DataTable(); adp.Fill(dt);

Go to the complete details ...