G
Guest
Hello -
Using C#, i am trying to convert a double value to string, so that it can be
assigned to a LABEL control on my Web Form Page. However, i continue to get
"invalid cast" errors. My code is as follows:
double i = 5;
double s = 10;
double r = i/s;
txtResult.text = System.Convert.ToString(r);
I would have expected that the string "0.5" would be the result. Obviously,
i don't konw something basic. If someone could point out what i'm doing
wrong, that would be great.
Thanks,
Using C#, i am trying to convert a double value to string, so that it can be
assigned to a LABEL control on my Web Form Page. However, i continue to get
"invalid cast" errors. My code is as follows:
double i = 5;
double s = 10;
double r = i/s;
txtResult.text = System.Convert.ToString(r);
I would have expected that the string "0.5" would be the result. Obviously,
i don't konw something basic. If someone could point out what i'm doing
wrong, that would be great.
Thanks,