K
kanepart2
Hi guys, I am having a problem with the following code snippet:-
double x = (myReader["TimeStamp"]);
double y = (myReader["YAxis"]);
Resulting in the follwing compilation error:
Cannot implicitly convert type 'object' to 'double'. An explicit
conversion exists (are you missing a cast?)
To fix this I modified the code to :-
double x = (double)(myReader["TimeStamp"]);
double y = (double)(myReader["YAxis"]);
with this there are no compilation errors but I get a runtime
exception saying :-
System.InvalidCastException: specified cast is not valid.
Any clues on how to fix this will be much appreciated.
double x = (myReader["TimeStamp"]);
double y = (myReader["YAxis"]);
Resulting in the follwing compilation error:
Cannot implicitly convert type 'object' to 'double'. An explicit
conversion exists (are you missing a cast?)
To fix this I modified the code to :-
double x = (double)(myReader["TimeStamp"]);
double y = (double)(myReader["YAxis"]);
with this there are no compilation errors but I get a runtime
exception saying :-
System.InvalidCastException: specified cast is not valid.
Any clues on how to fix this will be much appreciated.