c# - Datatable.select doesn't return all columns in the main data table -


i working datatable.select, in order data. code following:

for (int j=0; j<nstations.count();j++) {     var result= dailyweatherdata.select("stationname ='" + nstations[j]["stationname"] + "' , monthh>='" + sp_biofix.month + "' , monthh<='" + sp_date.month + "'").copytodatatable();     foreach (datarow row in result.rows)     {         weatherdata.importrow(row);     } } 

then ordered using following code :

weatherdata = weatherdata.asenumerable()                          .orderby(r => r.field<string>("stationname"))                          .copytodatatable(); 

that gave me following error:

the column "stationname" not belong datatable.

does mean need work datatable.where ? wrong in somewhere else?

i question replacing following loop:

foreach (datarow row in result.rows)    {     weatherdata.importrow(row);     } 

with following code :

 weatherdata.beginloaddata();                              weatherdata.merge(result);                              weatherdata.endloaddata(); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -