This thread not only highlights the importance of not assuming that
something is actually something you think it is, it also highlights the need
for communicating the problem and/or issue correctly and fully.
If the OP had actually read the actual exception message ("Input string was
not in a correct format.") or posted it verbatim, it would have been
painfully obvious that the content of the input string needed looking at.
Again, if the OP had actually read the information presented when the
exception was thrown, it would also have been obvious that a number of
'Troubleshooting tips' were being presented, one of which was a tip which
might be useful if the OP were doing something with a string that was
supposed to represent a DateTime.
As a result, the valuable time and effort of a number of responders was
wasted and I wouldn't blame if they thought twice about responding to posts
from the OP in the future.
Maybe I'm being a bit idealistic here, but this is a plea for posters to
take care when posting, especially:
* copying and pasting where appropriate, instead of attempting to type
something that needs to reported accurately,
* spelling and grammar - mispelled words and/or lack of or misplaced
punctuation are the fastest ways to ensure that something will be
misunderstood or misinterpreted, and
* most importantly, careful reading of documentation - I know how easy
it is misread, misinterpret and misunderstand information.
"mishj" <mi***@yahoo.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Well I worked it out in the end - because I was returning the result of
a Yahoo! maps api call (which is definitely a float type) into the text
field fromLat before the call to float.Parse, I had assumed that the
value was at that point "in" the text field. It turns out that until
the server side code completes, the textfield doesnt seem to actually
"get" the value passed into it, so at the point I was calling the
float.Parse the text field had nothing in it, even though I do nothing
to change it between then and when the textfield appears on the screen
with the float value clearly inside the text field. Seems rather
bizarre behaviour, but I had never used c# server side code behind an
asp.net page before this so I didnt understand how the text fields were
assigned values.
Sorry - I guess I should have checked beforehand that the float value
really was in this.fromLat.Text!! ;-)
Having said that, the error message completely threw me, and I dont
like the error message given what I was trying to do - it was nothing
to do with DateTime types, so no wonder I was totally confused!
Microsoft should come up with something better than that I feel. Why
do they assume that a float is a DateTime????
Thanks again guys..