[HttpPost] [ValidateAntiForgeryToken] public ActionResult Upload(HttpPostedFileBase upload) { if (ModelState.IsValid) { if (upload != null && upload.ContentLength > 0) { if (upload.FileName.EndsWith(".csv")) { Stream stream = upload.InputStream; DataTable csvTable = new DataTable(); using (CsvReader csvReader = new CsvReader(new StreamReader(stream), true)) { csvTable.Load(csvReader); } return View(csvTable); } else { ModelState.AddModelError("File", "This file format is not supported"); return View(); } } else { ModelState.AddModelError("File", "Please Upload Your file"); } } return View(); }
Error 1 The type or namespace name 'CsvReader' could not be found (are you missing a using directive or an assembly reference?)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)