W
Web learner
The following code works fine
private List<double> GetDataFor(string column, int selectedYear) {
-------
-------
return list;
}
foreach (double item in GetDataFor("AirTemp", selectedYear)) {
Response.Write(item.ToString() + ", ");
}
It shows data as follows:
37987, -2.42, 37988, -2.41, 37989, -3.34,....................................
where the five digit numbers correspond to date (the first one for 01 Jan 2004) and the decimal negative number as AirTemp. As you can see both are of type double.
I have to use this returned "list" of type double as follows:
double[] date = (DateTime)item; // ERROR Cannot convert type 'double' to 'System.DateTime'
double[] AirTemp = (double)item[1]; //
The above gives me error. I am confused what to do. There must be much better and elegant way to do this.
the Web_learner
private List<double> GetDataFor(string column, int selectedYear) {
-------
-------
return list;
}
foreach (double item in GetDataFor("AirTemp", selectedYear)) {
Response.Write(item.ToString() + ", ");
}
It shows data as follows:
37987, -2.42, 37988, -2.41, 37989, -3.34,....................................
where the five digit numbers correspond to date (the first one for 01 Jan 2004) and the decimal negative number as AirTemp. As you can see both are of type double.
I have to use this returned "list" of type double as follows:
double[] date = (DateTime)item; // ERROR Cannot convert type 'double' to 'System.DateTime'
double[] AirTemp = (double)item[1]; //
The above gives me error. I am confused what to do. There must be much better and elegant way to do this.
the Web_learner