Re: Very strange "input string not in correct format" bug



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.StringToNumber()
System.Number.ParseInt32()
System.Number.Int16.Parse()
Util.IPAddressBox.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@xxxxxxxxxxx> wrote in message
news:eKdCTELYHHA.596@xxxxxxxxxxxxxxxxxxxxxxx
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" <none@xxxxxxxxxxx> ha scritto nel messaggio
news:%233ZUVgCYHHA.4520@xxxxxxxxxxxxxxxxxxxxxxx
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.





.



Relevant Pages

  • Re: User control event problem
    ... Catch ex As Exception ... >I have a grid and a user control on the same page. ... > happens the page renders, but I need to update the grid information before ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Very strange "input string not in correct format" bug
    ... the trick of changing locale to something else and then back again did ... I hope Microsoft can eventually find and fix this! ... I tried to reproduce the exception by setting the thread culture to all ... cultures are the UI cultures but, I'd rather check first what are the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Usercontrol overriding Font causes exception
    ... I have a form with a user control, when the user control is added to ... Me.Controls an exception occurs (Object reference not set to an ... if the user control has a Font property (Public Overrides Property ... FontAs System.Drawing.Font), then the exception occurs. ...
    (microsoft.public.dotnet.framework)
  • VB6 WMP.DLL Access Violation
    ... I'm trying to create an OCX using VB6 with WMP 10 embedded, ... The steps to reproduce this and details on the exception are ... Add an instance of the wmp control to the user control ... The application doesn't exit properly. ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Exception handling in web user control
    ... I created a user control, but instead of handling exception in the ... When exception occurs I'm setting some of my controls' visibility ...
    (microsoft.public.dotnet.framework.aspnet)