Error is "to many value"
OleDbConnection con = null; string FilePath = Server.MapPath(Strfilename); string FileExt = System.IO.Path.GetExtension(FilePath); if (FileExt == ".xls") { con = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + FilePath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\""); } con.Open(); DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); Session["Dtexl"] = dt; if (dt.Rows.Count > 0) { string getExcelSheetName = dt.Rows[0]["Table_Name"].ToString(); OleDbCommand ExcelCommand = new OleDbCommand(@"SELECT * FROM [" + getExcelSheetName + @"]", con); OleDbDataAdapter ExcelAdapter = new OleDbDataAdapter(ExcelCommand); DataSet ExcelDataSet = new DataSet(); ExcelAdapter.Fill(ExcelDataSet);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)