Author: Jedi302 | Posted on: 10/7/2009 5:30:09 AM | Views : 252

hi could I somehow skip the headers in this csv somehow? thx for replies


var path = HttpContext.Current.Server.MapPath("~/TestFolder/"); var receiver = new Receiver(); fileUpload.SaveAs(path + fileUpload.FileName); var sr = new StreamReader(path + fileUpload.FileName, System.Text.Encoding.Default); string[] values = null; string inputLine; while ((inputLine = sr.ReadLine()) != null) { values = inputLine.Split((new char[] { ',' })); receiver.Name = values[0]; //value receiver.Email = values[1]; //value receiver.Age = int.Parse(values[2]); //value receiver.Gender = values[3]; //value } sr.Close(); sr.Dispose()






...

Go to the complete details ...