Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var path = Server.MapPath(@"~/Dealertrack-CSV-Example.csv");
            var data = CSVHelperClass.Read <DealerTrack>(new CsvSource(path)).ToList();

            gvDealerTrack.DataSource = data;
            gvDealerTrack.DataBind();

            var item = data.GroupBy(x => x.Vehicle).OrderByDescending(i => i.Count()).First().Key;

            txtMostCarSell.Text = item;
        }
Example #2
0
 public CsvSource(CSVHelperClass csvFile)
 {
     this.TextReader = new StreamReader(csvFile.BaseStream);
 }