Hey guys....so i'm using 'Excel data reader' to read in an excel file, I then want to display the file on screen.
I've added in the
Attempting to get the excel sheet to display on screen, although I'm having no luck with this. I think it is something like
but can't seem to get it going, ay help much appreciated.
Thank You
protected void Page_Load(object sender, EventArgs e) { string filePath = @"C:\WORK\BoireannSVN\trunk\VS\CRCConnect\Spreadsheet\Spreadsheet.xlsx"; FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read); IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream); excelReader.IsFirstRowAsColumnNames = true; DataSet result = excelReader.AsDataSet(); while (excelReader.Read()) { Label x = new Label(); x.Text = result.Tables[0].Rows[0].ItemArray[0].ToString(); uploadExcel.Controls.Add(x); excelReader.GetInt32(0); } excelReader.Close(); }
I've added in the
Label x = new Label(); x.Text = result.Tables[0].Rows[0].ItemArray[0].ToString();
Attempting to get the excel sheet to display on screen, although I'm having no luck with this. I think it is something like
table1.Columns.Add; table1.Rows.Add;
but can't seem to get it going, ay help much appreciated.
Thank You