Answers for "c# read excel file columns using epplus"

C#
0

c# read excel file columns using epplus

FileInfo excelFile = new FileInfo(excelFilePath); ;
                ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
                using (ExcelPackage package = new ExcelPackage(new FileInfo(excelFile.ToString())))
                {
                    foreach (ExcelWorksheet worksheet in package.Workbook.Worksheets)
                    {
                        List<string> ColumnNames = new List<string>();
                        for (int i = 1; i <= worksheet.Dimension.End.Column; i++)
                        {
                            ColumnNames.Add(worksheet.Cells[1, i].Value.ToString());                }
                    }
                }
Posted by: Guest on May-06-2022

C# Answers by Framework

Browse Popular Code Answers by Language