Strange Divide? Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WhiteWizard

    Strange Divide? Error

    Have we got a STRANGE one going here.

    We converted from 1.1 to 2.0 about 2 weeks ago and this has been a problem
    since then...but only on SOME machines in our development group. The
    application runs fine using 1.1 and on 3 of the 8 machines in our group. It
    is a Windows application.

    Our appliation has many user controls, and panels/viewing areas that we show
    in our app. In our application we several areas where we have to take a
    string and parse it into other data types; for
    instance--ushort.parse(st rSysID). On the problem machines this generates the
    following build error:

    A first chance exception of type 'System.FormatE xception' occurred in
    mscorlib.dll
    TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception: Input
    string was not in a correct format.
    at System.Number.S tringToNumber(S tring str, NumberStyles options,
    NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
    at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
    NumberFormatInf o numfmt)
    at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o info)
    at System.UInt16.P arse(String s)
    at ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
    specID, String wholeEnum) in D:\C-5 RERP\PVCS
    7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine 357

    In other parts of the application, we may be using the string in a different
    way(ie. we use the string/convert it to an int and use it as an index), and
    it gets past the build process, but at run time generates the following
    error, when trying to use a "0" in a string:

    System.FormatEx ception was unhandled
    Message="Input string was not in a correct format."
    Source="mscorli b"
    StackTrace:
    at System.Number.S tringToNumber(S tring str, NumberStyles options,
    NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
    at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
    NumberFormatInf o numfmt)
    at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
    info)
    at System.UInt16.P arse(String s)
    at ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
    dg) in D:\C-5 RERP\PVCS
    7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line 1290
    at
    ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object sender,
    EventArgs e) in D:\C-5 RERP\PVCS
    7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line 1052

    We know it has something to do with having a "0" in a string, but have NO
    idea, of why it happens on only some of the machines and not all (luckily I'm
    not one of the problem machines), and also why it works with 1.1 version of
    the framework, and not 2.0.

    Anyone have any ideas of what the problem is, or where we start looking?

    My apologies for the length of the post. Thanks in advance for any help.

    WhiteWizard
    aka Gandalf
    MCSD.NET, MCAD, MCT
  • Barry Kelly

    #2
    Re: Strange Divide? Error

    WhiteWizard <WhiteWizard@di scussions.micro soft.comwrote:
    Have we got a STRANGE one going here.
    I have difficulty understanding what your problem is. You're calling
    ushort.Parse() with a string, and it isn't a valid string, right? So
    panels / viewing areas and related discussion etc. is irrelevant, right?

    What exactly is the problem?
    at System.UInt16.P arse(String s)
    at ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
    dg) in D:\C-5 RERP\PVCS
    The code that's calling Parse is under your control - surely you can
    isolate the value that's being passed to ushort.Parse()?

    -- Barry

    --

    Comment

    • Ignacio Machin \( .NET/ C# MVP \)

      #3
      Re: Strange Divide? Error

      Hi,

      You have some error in the format of the number, can you post the code in
      question?
      Also compare one working machine and one with the error regarding the
      culture being used , especifucally the NumberFormatInf o benig used.


      --
      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation



      "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
      news:9A327A82-1E12-4DA2-9486-2A03C33C0410@mi crosoft.com...
      Have we got a STRANGE one going here.
      >
      We converted from 1.1 to 2.0 about 2 weeks ago and this has been a problem
      since then...but only on SOME machines in our development group. The
      application runs fine using 1.1 and on 3 of the 8 machines in our group.
      It
      is a Windows application.
      >
      Our appliation has many user controls, and panels/viewing areas that we
      show
      in our app. In our application we several areas where we have to take a
      string and parse it into other data types; for
      instance--ushort.parse(st rSysID). On the problem machines this generates
      the
      following build error:
      >
      A first chance exception of type 'System.FormatE xception' occurred in
      mscorlib.dll
      TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception: Input
      string was not in a correct format.
      at System.Number.S tringToNumber(S tring str, NumberStyles options,
      NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
      at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
      NumberFormatInf o numfmt)
      at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
      info)
      at System.UInt16.P arse(String s)
      at ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
      specID, String wholeEnum) in D:\C-5 RERP\PVCS
      7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine 357
      >
      In other parts of the application, we may be using the string in a
      different
      way(ie. we use the string/convert it to an int and use it as an index),
      and
      it gets past the build process, but at run time generates the following
      error, when trying to use a "0" in a string:
      >
      System.FormatEx ception was unhandled
      Message="Input string was not in a correct format."
      Source="mscorli b"
      StackTrace:
      at System.Number.S tringToNumber(S tring str, NumberStyles options,
      NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
      at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
      NumberFormatInf o numfmt)
      at System.UInt16.P arse(String s, NumberStyles style,
      NumberFormatInf o
      info)
      at System.UInt16.P arse(String s)
      at ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
      dg) in D:\C-5 RERP\PVCS
      7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
      1290
      at
      ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object
      sender,
      EventArgs e) in D:\C-5 RERP\PVCS
      7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
      1052
      >
      We know it has something to do with having a "0" in a string, but have NO
      idea, of why it happens on only some of the machines and not all (luckily
      I'm
      not one of the problem machines), and also why it works with 1.1 version
      of
      the framework, and not 2.0.
      >
      Anyone have any ideas of what the problem is, or where we start looking?
      >
      My apologies for the length of the post. Thanks in advance for any help.
      >
      WhiteWizard
      aka Gandalf
      MCSD.NET, MCAD, MCT

      Comment

      • WhiteWizard

        #4
        Re: Strange Divide? Error

        Ok, so I obviously didn't get the message out ;) I HATE it when that happens!

        The problem is that WHENEVER we have a string with a value of "0", we have a
        problem. The errors we just examples of some of the problems. And it
        appears that it ONLY happens when the value of the string is "0".

        We did check the versions of the framework we are using, but have NOT
        checked the NumberFormatInf o as suggested, so I'll do that today.

        Thanks for the responses!

        WhiteWizard
        aka Gandalf
        MCSD.NET, MCAD, MCT


        "Barry Kelly" wrote:
        WhiteWizard <WhiteWizard@di scussions.micro soft.comwrote:
        >
        Have we got a STRANGE one going here.
        >
        I have difficulty understanding what your problem is. You're calling
        ushort.Parse() with a string, and it isn't a valid string, right? So
        panels / viewing areas and related discussion etc. is irrelevant, right?
        >
        What exactly is the problem?
        >
        at System.UInt16.P arse(String s)
        at ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
        dg) in D:\C-5 RERP\PVCS
        >
        The code that's calling Parse is under your control - surely you can
        isolate the value that's being passed to ushort.Parse()?
        >
        -- Barry
        >
        --

        >

        Comment

        • WhiteWizard

          #5
          Re: Strange Divide? Error

          I have good news and bad news.

          The good news is that with Ignacio's suggestion we checked the
          NumberFormatInf o parameters and found that for the problem machines the
          PositiveSign Value is a 0, but only for en-US and only on the problem
          machines.

          I also verified that this is what was causing the problem by temporarily
          changing my value to a 0 and got the errors.

          The bad news is I cannot find any way to change the value back to a + sign
          as it is on the non-problem machines and for all other culture settings. I
          also have no idea HOW the bad ones were set to 0 in the first place.

          I found where you can change how the system treats negative numbers, but
          nothing so far on setting the PositiveSign value. Has anyone seen this
          before, or can anyone tell me how I might change the PositiveSign value?

          Thanks for your responses earlier. It definitely helped us isolate the
          problem.

          WhiteWizard
          aka Gandalf
          MCSD.NET, MCAD, MCT


          "Ignacio Machin ( .NET/ C# MVP )" wrote:
          Hi,
          >
          You have some error in the format of the number, can you post the code in
          question?
          Also compare one working machine and one with the error regarding the
          culture being used , especifucally the NumberFormatInf o benig used.
          >
          >
          --
          --
          Ignacio Machin,
          ignacio.machin AT dot.state.fl.us
          Florida Department Of Transportation
          >
          >
          >
          "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
          news:9A327A82-1E12-4DA2-9486-2A03C33C0410@mi crosoft.com...
          Have we got a STRANGE one going here.

          We converted from 1.1 to 2.0 about 2 weeks ago and this has been a problem
          since then...but only on SOME machines in our development group. The
          application runs fine using 1.1 and on 3 of the 8 machines in our group.
          It
          is a Windows application.

          Our appliation has many user controls, and panels/viewing areas that we
          show
          in our app. In our application we several areas where we have to take a
          string and parse it into other data types; for
          instance--ushort.parse(st rSysID). On the problem machines this generates
          the
          following build error:

          A first chance exception of type 'System.FormatE xception' occurred in
          mscorlib.dll
          TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception: Input
          string was not in a correct format.
          at System.Number.S tringToNumber(S tring str, NumberStyles options,
          NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
          at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
          NumberFormatInf o numfmt)
          at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
          info)
          at System.UInt16.P arse(String s)
          at ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
          specID, String wholeEnum) in D:\C-5 RERP\PVCS
          7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine 357

          In other parts of the application, we may be using the string in a
          different
          way(ie. we use the string/convert it to an int and use it as an index),
          and
          it gets past the build process, but at run time generates the following
          error, when trying to use a "0" in a string:

          System.FormatEx ception was unhandled
          Message="Input string was not in a correct format."
          Source="mscorli b"
          StackTrace:
          at System.Number.S tringToNumber(S tring str, NumberStyles options,
          NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
          at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
          NumberFormatInf o numfmt)
          at System.UInt16.P arse(String s, NumberStyles style,
          NumberFormatInf o
          info)
          at System.UInt16.P arse(String s)
          at ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
          dg) in D:\C-5 RERP\PVCS
          7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
          1290
          at
          ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object
          sender,
          EventArgs e) in D:\C-5 RERP\PVCS
          7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
          1052

          We know it has something to do with having a "0" in a string, but have NO
          idea, of why it happens on only some of the machines and not all (luckily
          I'm
          not one of the problem machines), and also why it works with 1.1 version
          of
          the framework, and not 2.0.

          Anyone have any ideas of what the problem is, or where we start looking?

          My apologies for the length of the post. Thanks in advance for any help.

          WhiteWizard
          aka Gandalf
          MCSD.NET, MCAD, MCT
          >
          >
          >

          Comment

          • Ignacio Machin \( .NET/ C# MVP \)

            #6
            Re: Strange Divide? Error

            Hi,


            One of the Parse variants takes a NumberFormatInf o you can use it. The weird
            thing is that you say that you get error not when you have a '+' in front
            but when you have a 0 , so +1 is ok, , but 01 which is kind of weird.

            why don't you try with this version and use InvariantCultur e as the
            parameter.


            --
            --
            Ignacio Machin,
            ignacio.machin AT dot.state.fl.us
            Florida Department Of Transportation


            "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
            news:733A5C0F-410F-44AF-8C39-55634A91E054@mi crosoft.com...
            >I have good news and bad news.
            >
            The good news is that with Ignacio's suggestion we checked the
            NumberFormatInf o parameters and found that for the problem machines the
            PositiveSign Value is a 0, but only for en-US and only on the problem
            machines.
            >
            I also verified that this is what was causing the problem by temporarily
            changing my value to a 0 and got the errors.
            >
            The bad news is I cannot find any way to change the value back to a + sign
            as it is on the non-problem machines and for all other culture settings.
            I
            also have no idea HOW the bad ones were set to 0 in the first place.
            >
            I found where you can change how the system treats negative numbers, but
            nothing so far on setting the PositiveSign value. Has anyone seen this
            before, or can anyone tell me how I might change the PositiveSign value?
            >
            Thanks for your responses earlier. It definitely helped us isolate the
            problem.
            >
            WhiteWizard
            aka Gandalf
            MCSD.NET, MCAD, MCT
            >
            >
            "Ignacio Machin ( .NET/ C# MVP )" wrote:
            >
            >Hi,
            >>
            >You have some error in the format of the number, can you post the code in
            >question?
            >Also compare one working machine and one with the error regarding the
            >culture being used , especifucally the NumberFormatInf o benig used.
            >>
            >>
            >--
            >--
            >Ignacio Machin,
            >ignacio.mach in AT dot.state.fl.us
            >Florida Department Of Transportation
            >>
            >>
            >>
            >"WhiteWizard " <WhiteWizard@di scussions.micro soft.comwrote in message
            >news:9A327A8 2-1E12-4DA2-9486-2A03C33C0410@mi crosoft.com...
            Have we got a STRANGE one going here.
            >
            We converted from 1.1 to 2.0 about 2 weeks ago and this has been a
            problem
            since then...but only on SOME machines in our development group. The
            application runs fine using 1.1 and on 3 of the 8 machines in our
            group.
            It
            is a Windows application.
            >
            Our appliation has many user controls, and panels/viewing areas that we
            show
            in our app. In our application we several areas where we have to take
            a
            string and parse it into other data types; for
            instance--ushort.parse(st rSysID). On the problem machines this
            generates
            the
            following build error:
            >
            A first chance exception of type 'System.FormatE xception' occurred in
            mscorlib.dll
            TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception:
            Input
            string was not in a correct format.
            at System.Number.S tringToNumber(S tring str, NumberStyles options,
            NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
            at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
            NumberFormatInf o numfmt)
            at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
            info)
            at System.UInt16.P arse(String s)
            at
            ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
            specID, String wholeEnum) in D:\C-5 RERP\PVCS
            7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine
            357
            >
            In other parts of the application, we may be using the string in a
            different
            way(ie. we use the string/convert it to an int and use it as an index),
            and
            it gets past the build process, but at run time generates the following
            error, when trying to use a "0" in a string:
            >
            System.FormatEx ception was unhandled
            Message="Input string was not in a correct format."
            Source="mscorli b"
            StackTrace:
            at System.Number.S tringToNumber(S tring str, NumberStyles options,
            NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
            at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
            NumberFormatInf o numfmt)
            at System.UInt16.P arse(String s, NumberStyles style,
            NumberFormatInf o
            info)
            at System.UInt16.P arse(String s)
            at
            ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
            dg) in D:\C-5 RERP\PVCS
            7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
            1290
            at
            ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object
            sender,
            EventArgs e) in D:\C-5 RERP\PVCS
            7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
            1052
            >
            We know it has something to do with having a "0" in a string, but have
            NO
            idea, of why it happens on only some of the machines and not all
            (luckily
            I'm
            not one of the problem machines), and also why it works with 1.1
            version
            of
            the framework, and not 2.0.
            >
            Anyone have any ideas of what the problem is, or where we start
            looking?
            >
            My apologies for the length of the post. Thanks in advance for any
            help.
            >
            WhiteWizard
            aka Gandalf
            MCSD.NET, MCAD, MCT
            >>
            >>
            >>

            Comment

            • Claes Bergefall

              #7
              Re: Strange Divide? Error

              You should be able to change them in the registry at
              HKEY_CURRENT_US ER\Control Panel\Internati onal
              or
              HKEY_USERS\.DEF AULT\Control Panel\Internati onal

              The value your looking for is sPositiveSign. It is set to an empty string on
              my machine

              /claes

              "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
              news:733A5C0F-410F-44AF-8C39-55634A91E054@mi crosoft.com...
              >I have good news and bad news.
              >
              The good news is that with Ignacio's suggestion we checked the
              NumberFormatInf o parameters and found that for the problem machines the
              PositiveSign Value is a 0, but only for en-US and only on the problem
              machines.
              >
              I also verified that this is what was causing the problem by temporarily
              changing my value to a 0 and got the errors.
              >
              The bad news is I cannot find any way to change the value back to a + sign
              as it is on the non-problem machines and for all other culture settings.
              I
              also have no idea HOW the bad ones were set to 0 in the first place.
              >
              I found where you can change how the system treats negative numbers, but
              nothing so far on setting the PositiveSign value. Has anyone seen this
              before, or can anyone tell me how I might change the PositiveSign value?
              >
              Thanks for your responses earlier. It definitely helped us isolate the
              problem.
              >
              WhiteWizard
              aka Gandalf
              MCSD.NET, MCAD, MCT
              >
              >
              "Ignacio Machin ( .NET/ C# MVP )" wrote:
              >
              >Hi,
              >>
              >You have some error in the format of the number, can you post the code in
              >question?
              >Also compare one working machine and one with the error regarding the
              >culture being used , especifucally the NumberFormatInf o benig used.
              >>
              >>
              >--
              >--
              >Ignacio Machin,
              >ignacio.mach in AT dot.state.fl.us
              >Florida Department Of Transportation
              >>
              >>
              >>
              >"WhiteWizard " <WhiteWizard@di scussions.micro soft.comwrote in message
              >news:9A327A8 2-1E12-4DA2-9486-2A03C33C0410@mi crosoft.com...
              Have we got a STRANGE one going here.
              >
              We converted from 1.1 to 2.0 about 2 weeks ago and this has been a
              problem
              since then...but only on SOME machines in our development group. The
              application runs fine using 1.1 and on 3 of the 8 machines in our
              group.
              It
              is a Windows application.
              >
              Our appliation has many user controls, and panels/viewing areas that we
              show
              in our app. In our application we several areas where we have to take
              a
              string and parse it into other data types; for
              instance--ushort.parse(st rSysID). On the problem machines this
              generates
              the
              following build error:
              >
              A first chance exception of type 'System.FormatE xception' occurred in
              mscorlib.dll
              TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception:
              Input
              string was not in a correct format.
              at System.Number.S tringToNumber(S tring str, NumberStyles options,
              NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
              at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
              NumberFormatInf o numfmt)
              at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
              info)
              at System.UInt16.P arse(String s)
              at
              ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
              specID, String wholeEnum) in D:\C-5 RERP\PVCS
              7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine
              357
              >
              In other parts of the application, we may be using the string in a
              different
              way(ie. we use the string/convert it to an int and use it as an index),
              and
              it gets past the build process, but at run time generates the following
              error, when trying to use a "0" in a string:
              >
              System.FormatEx ception was unhandled
              Message="Input string was not in a correct format."
              Source="mscorli b"
              StackTrace:
              at System.Number.S tringToNumber(S tring str, NumberStyles options,
              NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
              at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
              NumberFormatInf o numfmt)
              at System.UInt16.P arse(String s, NumberStyles style,
              NumberFormatInf o
              info)
              at System.UInt16.P arse(String s)
              at
              ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
              dg) in D:\C-5 RERP\PVCS
              7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
              1290
              at
              ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object
              sender,
              EventArgs e) in D:\C-5 RERP\PVCS
              7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
              1052
              >
              We know it has something to do with having a "0" in a string, but have
              NO
              idea, of why it happens on only some of the machines and not all
              (luckily
              I'm
              not one of the problem machines), and also why it works with 1.1
              version
              of
              the framework, and not 2.0.
              >
              Anyone have any ideas of what the problem is, or where we start
              looking?
              >
              My apologies for the length of the post. Thanks in advance for any
              help.
              >
              WhiteWizard
              aka Gandalf
              MCSD.NET, MCAD, MCT
              >>
              >>
              >>

              Comment

              • WhiteWizard

                #8
                Re: Strange Divide? Error

                Thanks for the response, but I checked the problem machine, and both of those
                registry entries show an empty string.

                While I love puzzles like this as much as the next guy, this is getting
                REALLY ridiculous! ;)

                WhiteWizard
                aka Gandalf
                MCSD.NET, MCAD, MCT


                "Claes Bergefall" wrote:
                You should be able to change them in the registry at
                HKEY_CURRENT_US ER\Control Panel\Internati onal
                or
                HKEY_USERS\.DEF AULT\Control Panel\Internati onal
                >
                The value your looking for is sPositiveSign. It is set to an empty string on
                my machine
                >
                /claes
                >
                "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
                news:733A5C0F-410F-44AF-8C39-55634A91E054@mi crosoft.com...
                I have good news and bad news.

                The good news is that with Ignacio's suggestion we checked the
                NumberFormatInf o parameters and found that for the problem machines the
                PositiveSign Value is a 0, but only for en-US and only on the problem
                machines.

                I also verified that this is what was causing the problem by temporarily
                changing my value to a 0 and got the errors.

                The bad news is I cannot find any way to change the value back to a + sign
                as it is on the non-problem machines and for all other culture settings.
                I
                also have no idea HOW the bad ones were set to 0 in the first place.

                I found where you can change how the system treats negative numbers, but
                nothing so far on setting the PositiveSign value. Has anyone seen this
                before, or can anyone tell me how I might change the PositiveSign value?

                Thanks for your responses earlier. It definitely helped us isolate the
                problem.

                WhiteWizard
                aka Gandalf
                MCSD.NET, MCAD, MCT


                "Ignacio Machin ( .NET/ C# MVP )" wrote:
                Hi,
                >
                You have some error in the format of the number, can you post the code in
                question?
                Also compare one working machine and one with the error regarding the
                culture being used , especifucally the NumberFormatInf o benig used.
                >
                >
                --
                --
                Ignacio Machin,
                ignacio.machin AT dot.state.fl.us
                Florida Department Of Transportation
                >
                >
                >
                "WhiteWizar d" <WhiteWizard@di scussions.micro soft.comwrote in message
                news:9A327A82-1E12-4DA2-9486-2A03C33C0410@mi crosoft.com...
                Have we got a STRANGE one going here.

                We converted from 1.1 to 2.0 about 2 weeks ago and this has been a
                problem
                since then...but only on SOME machines in our development group. The
                application runs fine using 1.1 and on 3 of the 8 machines in our
                group.
                It
                is a Windows application.

                Our appliation has many user controls, and panels/viewing areas that we
                show
                in our app. In our application we several areas where we have to take
                a
                string and parse it into other data types; for
                instance--ushort.parse(st rSysID). On the problem machines this
                generates
                the
                following build error:

                A first chance exception of type 'System.FormatE xception' occurred in
                mscorlib.dll
                TestPointSpec: Error TP 774 not a number 0 System.FormatEx ception:
                Input
                string was not in a correct format.
                at System.Number.S tringToNumber(S tring str, NumberStyles options,
                NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
                at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
                NumberFormatInf o numfmt)
                at System.UInt16.P arse(String s, NumberStyles style, NumberFormatInf o
                info)
                at System.UInt16.P arse(String s)
                at
                ConfigurationFi les.TestPointSp ecificationFile .ParseEnumerati on(UInt16
                specID, String wholeEnum) in D:\C-5 RERP\PVCS
                7-26-06\Common\Confi gurationFiles\T estPointSpecifi cationFile.cs:l ine
                357

                In other parts of the application, we may be using the string in a
                different
                way(ie. we use the string/convert it to an int and use it as an index),
                and
                it gets past the build process, but at run time generates the following
                error, when trying to use a "0" in a string:

                System.FormatEx ception was unhandled
                Message="Input string was not in a correct format."
                Source="mscorli b"
                StackTrace:
                at System.Number.S tringToNumber(S tring str, NumberStyles options,
                NumberBuffer& number, NumberFormatInf o info, Boolean parseDecimal)
                at System.Number.P arseUInt32(Stri ng value, NumberStyles options,
                NumberFormatInf o numfmt)
                at System.UInt16.P arse(String s, NumberStyles style,
                NumberFormatInf o
                info)
                at System.UInt16.P arse(String s)
                at
                ApplicationFram e.SubsystemBrow serControl.GetS electedRows(Dat aGrid
                dg) in D:\C-5 RERP\PVCS
                7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
                1290
                at
                ApplicationFram e.SubsystemBrow serControl.addT PmenuItem_Click (Object
                sender,
                EventArgs e) in D:\C-5 RERP\PVCS
                7-26-06\PCIU_CSCI\Us erInterfaceComp onents\Subsyste mBrowserControl .cs:line
                1052

                We know it has something to do with having a "0" in a string, but have
                NO
                idea, of why it happens on only some of the machines and not all
                (luckily
                I'm
                not one of the problem machines), and also why it works with 1.1
                version
                of
                the framework, and not 2.0.

                Anyone have any ideas of what the problem is, or where we start
                looking?

                My apologies for the length of the post. Thanks in advance for any
                help.

                WhiteWizard
                aka Gandalf
                MCSD.NET, MCAD, MCT
                >
                >
                >
                >
                >
                >

                Comment

                • mike

                  #9
                  Re: Strange Divide? Error

                  did you ever solve this issue?
                  I am have the same problem. Can not insert a 0 (zero) into the datagridview.

                  Comment

                  Working...