c# - Optimizing DataTable Data loading -


i trying load data datatable. currently, loading 14000 rows , 3 columns, taking 2 mins. want optimize this.

sorteddates size 14k rows.

this.timeseriesdatatable.beginloaddata(); foreach (var date in sorteddates) {     datarow newrow = this.timeseriesdatatable.newrow();      newrow["dates"] = datetime.parseexact(date.tostring(), "yyyymmdd", cultureinfo.invariantculture);      // each series represent columns. no of cols based on user selection.             foreach (timeseries sr in series)      {         // getting json structure sep array of dates/values.          // creating dic zipping 2 list.          dictionary<int, double> datevaluesmap = sr.datesvaluesdic;          double val;         double seriesvalue = datevaluesmap.trygetvalue(date, out val) ? val :  constants.navalue;         if (!isna(seriesvalue)) newrow[sr.label] = seriesvalue;         else newrow[sr.label] = constants.navalue;         newrow[sr.label] = seriesvalue;     }     this.timeseriesdatatable.rows.add(newrow); } this.timeseriesdatatable.endloaddata(); 

how can optimize this? there better way this? should not using datatable @ all?


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -