NullReferenceException in creating Excel worksheet
问题 i want to fill an excel file and so i use ExcelPackage: Office Open XML Format . but i have an error. my code: string fileName = "DBE_BAKIM_FORMU" + ".xlsx"; FileInfo fi = new FileInfo(HttpContext.Current.Server.MapPath("~/") + fileName); using (ExcelPackage xlPackage = new ExcelPackage(fi)) { ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1]; dbeDataContext db = new dbeDataContext(); CAGRI c = (from x in db.CAGRIs where x.CagriID == ID select x).SingleOrDefault(); USER u = (from x