I'm glad my suggestion was helpful and that you found out, what was
wrong... 

Paul

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Nicholls
Sent: Wednesday, October 04, 2006 12:15
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Completely unbelievable exception.....

For the aid of other poor souls that have this problem, I will post what
the
problem actually is, and possible ways to solve it....though I'm not
convinced the developmentor site is actually going at the moment.

System.FormatException: Input string was not in a correct format. at
System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer&
number, NumberFormatInfo info, Boolean parseDecimal) at
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo
info) at System.Int32.Parse(String s)

The problem is related to System.Globalization.CultureInfo as Paul van
Brenk
said.....and specifically (in this case, and others I've since found on
the
internet) to the value of "NumberFormat.PositiveSign".... for us this
was
set to "1" on random machines ! (other examples I have seen reported are
set
to "0").....which I assume meant that StringToNumber would read "1" as
"+"
and then complain it didn't make sense....the value is associated to the
users regional settings, and though the user can access "NegativeSign"
through control panel, it appears that they cannot access
"PositiveSign".....why anything or anyone has set this I don't know...I
can
only assume it is some sort of virus.....I think it only affects .net
v2.0...but that's a guess...it seems a very easy way to break lots of
.net
apps, sometimes in quite subtle manners.

You can fix it by (Paul van Brenk) explicitly setting the
culture....which
seems very sensible....(obviously there are times when you want to
interpret
in the local culture, and then you are at the mercy of that local
culture
settings).
Int32.Parse( "1", System.Globalization.CultureInfo.InvariantCulture );

You can fix also by setting HKEY_CURRENT_USER\Control
Panel\International\
PositiveSign (I think that's right) to blank...or whatever seems
sensible.

See

http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/top
ic50
011.aspx

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Nicholls
Sent: 28 September 2006 13:47
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Completely unbelievable exception.....

Oh right ok.

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Brady Kelly
Sent: 28 September 2006 13:38
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Completely unbelievable exception.....

I don't recall.  I think I may have done something horrific like change
the
type of the database field.  It wasn't a huge, demanding production
application.

> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Mark Nicholls
> Sent: 28 September 2006 02:30 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Completely unbelievable exception.....
>
> Thanks, at least I'm not going completely mad.
>
> How did you avoid it?
>
>
>
> -----Original Message-----
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Brady Kelly
> Sent: 28 September 2006 13:07
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Completely unbelievable exception.....
>
> I can't offer any help, but I too have encountered this problem.
However,
> I
> solved my problem by avoiding the Parse call altogether.
>
> > I'm not a new boy at this game....I've been using c# for about 3
years
> or
> > so.....
> >
> > int.Parse("1");
> >
> > got to work!.....
> >
> > See the end of this message for details on invoking
> > just-in-time (JIT) debugging instead of this dialog box.
> >
> > ************** Exception Text **************
> > System.FormatException: Input string was not in a correct format.
> >    at System.Number.StringToNumber(String str, NumberStyles options,
> > NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
> >    at System.Number.ParseInt32(String s, NumberStyles style,
> > NumberFormatInfo info)
> >    at System.Int32.Parse(String s)
> >
> >
> >
> >
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >
> >
> > it works on all the dev machines....but run it on a client machine
and
> > boooommm...
> >
> > log into the client machine (with admin rights....and possibly known
as
> UK
> > user rather than US).....and it works!!!!!!!!!
> >
> > can't get my head around it.
> >
> > ===================================
> > This list is hosted by DevelopMentorR  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
>
>
************************************************************************
**
> *
> CONFIDENTIALITY NOTICE
>
> The contents of this e-mail are confidential to the ordinary user
> of the e-mail address to which it was addressed, and may also
> be privileged.  If you are not the addressee of this e-mail you may
> not copy, forward, disclose or otherwise use it or any part of it
> in any form whatsoever.If you have received this e-mail in error,
> please e-mail the sender by replying to this message.
>
> It is your responsibility to carry out appropriate virus and other
> checks to ensure that this message and any attachments do not
> affect your systems / data. Any views or opinions expressed in this
> e-mail are solely those of the author and do not necessarily
> represent those of MTV Networks Europe unless specifically stated,
> nor does this message form any part of any contract unless so stated.
>
> MTV reserves the right to monitor e-mail communications from
> external/internal sources for the purposes of ensuring correct
> and appropriate use of MTV communication equipment.
>
> MTV Networks Europe
>
************************************************************************
**
> *
>
>
> ===================================
> This list is hosted by DevelopMentorR  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to