how do I examine parameters in an exception?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • help@work.r.us

    how do I examine parameters in an exception?

    If I enable debug at C# exceptions, it dutifully breaks and shows me the stack
    of called procedures. At the top (of my list) is DateTime.ParseE xact() and it
    does through an exception if I proceed.

    But, how can I examine the parameters to that call to see what it doesn't like?

    tnx,
    /steveA
  • Greg Ewing [MVP]

    #2
    Re: how do I examine parameters in an exception?

    /steveA, two quick options, you can put a break point right before the call
    to your exception throwing function or put some debug statements which spit
    out the variables being passed.

    --
    Greg Ewing [MVP]
    Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.


    <help@work.r.us > wrote in message
    news:hcq8nvspkj 33t4pdjt86i8iu4 8gfpv1skg@4ax.c om...[color=blue]
    > If I enable debug at C# exceptions, it dutifully breaks and shows me the[/color]
    stack[color=blue]
    > of called procedures. At the top (of my list) is DateTime.ParseE xact()[/color]
    and it[color=blue]
    > does through an exception if I proceed.
    >
    > But, how can I examine the parameters to that call to see what it doesn't[/color]
    like?[color=blue]
    >
    > tnx,
    > /steveA[/color]


    Comment

    • Pietje de kort

      #3
      Re: how do I examine parameters in an exception?

      right click paramater -> quickwatch.

      help@work.r.us wrote in message news:<hcq8nvspk j33t4pdjt86i8iu 48gfpv1skg@4ax. com>...[color=blue]
      > If I enable debug at C# exceptions, it dutifully breaks and shows me the stack
      > of called procedures. At the top (of my list) is DateTime.ParseE xact() and it
      > does through an exception if I proceed.
      >
      > But, how can I examine the parameters to that call to see what it doesn't like?
      >
      > tnx,
      > /steveA[/color]

      Comment

      • help@work.r.us

        #4
        Re: how do I examine parameters in an exception?

        On Sat, 27 Sep 2003 00:32:36 -0400, "Greg Ewing [MVP]"
        <gewing@_NO_SPA M_gewing.com> wrote:
        [color=blue]
        >/steveA, two quick options, you can put a break point right before the call
        >to your exception throwing function or put some debug statements which spit
        >out the variables being passed.[/color]

        Let me be more precise. I have a dataset where I have "dynamicall y" constructed
        a table, including a column of type System.DateTime . I then call ds.ReadXml()
        to process the input. Unless code is available for this, I can't step into it,
        nor do a quickwatch. If I set debug to halt on a thrown exception, the stack
        shows a call to DateTime.ParseE xact() on top - but there is no way to examine
        the variables (I think it might be because the exception is on its way out).

        Anyway, if instead, I do a table.Rows.Add( new Object[] {...} ) of the same
        strings from the xml message, this works fine! gag!

        Is this a feature or bug of ReadXml? I'd like to know what the other parameters
        are to the ParseExact()...

        /steveA

        Comment

        • Greg Ewing [MVP]

          #5
          Re: how do I examine parameters in an exception?

          /steveA, if sounds like you are putting an invalid Date in your dataset.
          Try removing the dates (set them to null). If that works then check the
          format of your dates to make sure that they are XML compliant. If that
          doesn't work post here with the results and some sample data.

          --
          Greg Ewing [MVP]
          Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.


          <help@work.r.us > wrote in message
          news:ri9bnvco23 9615ms8oe3r2ean st9ns72lb@4ax.c om...[color=blue]
          > On Sat, 27 Sep 2003 00:32:36 -0400, "Greg Ewing [MVP]"
          > <gewing@_NO_SPA M_gewing.com> wrote:
          >[color=green]
          > >/steveA, two quick options, you can put a break point right before the[/color][/color]
          call[color=blue][color=green]
          > >to your exception throwing function or put some debug statements which[/color][/color]
          spit[color=blue][color=green]
          > >out the variables being passed.[/color]
          >
          > Let me be more precise. I have a dataset where I have "dynamicall y"[/color]
          constructed[color=blue]
          > a table, including a column of type System.DateTime . I then call[/color]
          ds.ReadXml()[color=blue]
          > to process the input. Unless code is available for this, I can't step[/color]
          into it,[color=blue]
          > nor do a quickwatch. If I set debug to halt on a thrown exception, the[/color]
          stack[color=blue]
          > shows a call to DateTime.ParseE xact() on top - but there is no way to[/color]
          examine[color=blue]
          > the variables (I think it might be because the exception is on its way[/color]
          out).[color=blue]
          >
          > Anyway, if instead, I do a table.Rows.Add( new Object[] {...} ) of the[/color]
          same[color=blue]
          > strings from the xml message, this works fine! gag!
          >
          > Is this a feature or bug of ReadXml? I'd like to know what the other[/color]
          parameters[color=blue]
          > are to the ParseExact()...
          >
          > /steveA[/color]


          Comment

          Working...