I can't really do a detailed analysis of the differences because the
offending machine is not accessible to me at the moment.
What the code is doing is it's taking a string from a TextBox that is part
of a User Control and converting it to a short. The exception's trace looks
something like this:
System.Number.S tringToNumber()
System.Number.P arseInt32()
System.Number.I nt16.Parse()
Util.IPAddressB ox.get_Octet3() <-- this is an Int16 property in my user
control
I'm not sure why the call to ParseInt32 is there but I guess that's the way
it works. I've also seen the exception happen with textboxes that convert
right to Int32 instead of Int16. They are also accessed through a property
of a user control.
I am having the guy that owns the machine try the "set locale to something
else then back again to English (US)" trick that someone mentioned to see if
that fixes it. If it does not I'll pursue additional debugging.
"Laura T." <LT@NOWHERE.COM wrote in message
news:eK******** *****@TK2MSFTNG P06.phx.gbl...
What diffrences have the machines that generate exception?
Framework version, hot fixes, OS fixes, UI language/culture etc.?
I tried to reproduce the exception by setting the thread culture to all
possibile cultures I have (158) but did not get any exception from
Convert.ToInt16 ("172").
The only thing I cannot test that could have something to do with cultures
are the UI cultures but, I'd rather check first what are the differences.
"Jen" <no**@nowhere.c omha scritto nel messaggio
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>One user of my application is experiencing an exception "input string not
in correct format". But it makes no sense where it is occurring. It is
occurring when a string from a textbox ("172") is being convert to an
Int16 (using Convert.ToInt16 ). How can that be? There are other text
boxes that are used in the identical fashion and they don't generate the
exception. All there are many other machines running my application that
don't generate the exception at all.
I have no idea what the problem could be and am looking for ideas.