string f = fu.PostedFile.FileName; string fileType = f.Split('.')[1]; OleDbConnection excelCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + f + ";Extended Properties=Excel 8.0"); if (excelCon.State == ConnectionState.Closed) { excelCon.Open(); } OleDbCommand excelCom = new OleDbCommand("SELECT * FROM [Sheet1$]", excelCon); OleDbDataAdapter excelAdp = new OleDbDataAdapter(excelCom); DataSet excelDs = new DataSet(); excelAdp.Fill(excelDs); gvSending.DataSource = excelDs.Tables[0]; gvSending.DataBind(); excelCon.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)