I wanna read the values of each cell in the excel thru my c# code
im using the following line of code but its not working
pla tell me whats wrong here and suggest me the correct solution thnx
Code:excel = new Microsoft.Office.Interop.Excel.Application(); excelworkbook = (Microsoft.Office.Interop.Excel._Workbook)(excel.Workbooks.Add("C:\\A.xls"); excelworksheet = (Microsoft.Office.Interop.Excel._Worksheet)excelworkbook.Sheets[1]; for (int i = 1; i <= excelworksheet.UsedRange.Columns.Count; i++) tdbExcel.Columns[i - 1].Text = excelworksheet.UsedRange.get_Item(1, i).ToString();




Reply With Quote