Need help

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

    Need help

    Hi!
    Here is problem I got.
    I use vb.net and MSSQL Server 2000.
    My dropdownlist box gets information from view, and it works. However when I
    am trying to get information from the dropdownlist I get error message.
    Also during step by step debug dropPP.Selected Item.Text gets value "NOTHING"

    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.NullRefe renceException: Object reference not set
    to an instance of an object.

    Source Error:

    Line 442: If txtPD.Text <> "" Then .Item("dept_cod e") =
    txtPD.Text
    Line 443: If txtEffort.Text <> "" Then .Item("effort") =
    txtEffort.Text
    Line 444: If dropPP.Selected Item.Text <> "" Then
    ..Item("dept_na me") = dropPP.Selected Item.Text
    Line 445: 'If dropBT.Selected Item.Text <> "" Then
    ..Item("budget_ title") = dropBT.Selected Item.Text
    Line 446: If txtStart.Text <> "" Then .Item("efft_dat e_from") =
    txtStart.Text Else .Item("efft_dat e_from") = 0


    Thanks.

    Vlad


  • Phil G.

    #2
    Re: Need help

    Hi,

    I am by no means experienced in asp.net however, I do know that unless you
    know what you are doing it is a bit of a mine-field wrt maintaining state.

    You might find that your data is being lost (or not maintained) between when
    you display it and when you try to use it, ie. when you select an item.

    This doesn't help you to 'fix' your problem but may give you something to
    think about (or maybe not!! :-)

    Good luck.

    Phil

    "vladp" <vladp@camba.or g> wrote in message
    news:OIE9VeMpFH A.2720@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi!
    > Here is problem I got.
    > I use vb.net and MSSQL Server 2000.
    > My dropdownlist box gets information from view, and it works. However when
    > I am trying to get information from the dropdownlist I get error message.
    > Also during step by step debug dropPP.Selected Item.Text gets value
    > "NOTHING"
    >
    > Object reference not set to an instance of an object.
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.NullRefe renceException: Object reference not set
    > to an instance of an object.
    >
    > Source Error:
    >
    > Line 442: If txtPD.Text <> "" Then .Item("dept_cod e") =
    > txtPD.Text
    > Line 443: If txtEffort.Text <> "" Then .Item("effort") =
    > txtEffort.Text
    > Line 444: If dropPP.Selected Item.Text <> "" Then
    > .Item("dept_nam e") = dropPP.Selected Item.Text
    > Line 445: 'If dropBT.Selected Item.Text <> "" Then
    > .Item("budget_t itle") = dropBT.Selected Item.Text
    > Line 446: If txtStart.Text <> "" Then .Item("efft_dat e_from") =
    > txtStart.Text Else .Item("efft_dat e_from") = 0
    >
    >
    > Thanks.
    >
    > Vlad
    >[/color]


    Comment

    • vladp

      #3
      Re: Need help

      It is getting lost.
      Thanks
      "Phil G." <Phil@nospam.co m> wrote in message
      news:de5ass$m2h $1@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com...[color=blue]
      > Hi,
      >
      > I am by no means experienced in asp.net however, I do know that unless you
      > know what you are doing it is a bit of a mine-field wrt maintaining state.
      >
      > You might find that your data is being lost (or not maintained) between
      > when you display it and when you try to use it, ie. when you select an
      > item.
      >
      > This doesn't help you to 'fix' your problem but may give you something to
      > think about (or maybe not!! :-)
      >
      > Good luck.
      >
      > Phil
      >
      > "vladp" <vladp@camba.or g> wrote in message
      > news:OIE9VeMpFH A.2720@TK2MSFTN GP10.phx.gbl...[color=green]
      >> Hi!
      >> Here is problem I got.
      >> I use vb.net and MSSQL Server 2000.
      >> My dropdownlist box gets information from view, and it works. However
      >> when I am trying to get information from the dropdownlist I get error
      >> message.
      >> Also during step by step debug dropPP.Selected Item.Text gets value
      >> "NOTHING"
      >>
      >> Object reference not set to an instance of an object.
      >> Description: An unhandled exception occurred during the execution of the
      >> current web request. Please review the stack trace for more information
      >> about the error and where it originated in the code.
      >>
      >> Exception Details: System.NullRefe renceException: Object reference not
      >> set to an instance of an object.
      >>
      >> Source Error:
      >>
      >> Line 442: If txtPD.Text <> "" Then .Item("dept_cod e") =
      >> txtPD.Text
      >> Line 443: If txtEffort.Text <> "" Then .Item("effort") =
      >> txtEffort.Text
      >> Line 444: If dropPP.Selected Item.Text <> "" Then
      >> .Item("dept_nam e") = dropPP.Selected Item.Text
      >> Line 445: 'If dropBT.Selected Item.Text <> "" Then
      >> .Item("budget_t itle") = dropBT.Selected Item.Text
      >> Line 446: If txtStart.Text <> "" Then .Item("efft_dat e_from")
      >> = txtStart.Text Else .Item("efft_dat e_from") = 0
      >>
      >>
      >> Thanks.
      >>
      >> Vlad
      >>[/color]
      >
      >[/color]


      Comment

      • Phil G.

        #4
        Re: Need help

        Have you included in your Page directive about viewstate? If not, add this
        in your html code (top line):-

        <%Page enableViewState ="true" %>

        Rgds, Phil

        "vladp" <vladp@camba.or g> wrote in message
        news:emGzAPPpFH A.2904@TK2MSFTN GP12.phx.gbl...[color=blue]
        > It is getting lost.
        > Thanks
        > "Phil G." <Phil@nospam.co m> wrote in message
        > news:de5ass$m2h $1@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com...[color=green]
        >> Hi,
        >>
        >> I am by no means experienced in asp.net however, I do know that unless
        >> you know what you are doing it is a bit of a mine-field wrt maintaining
        >> state.
        >>
        >> You might find that your data is being lost (or not maintained) between
        >> when you display it and when you try to use it, ie. when you select an
        >> item.
        >>
        >> This doesn't help you to 'fix' your problem but may give you something to
        >> think about (or maybe not!! :-)
        >>
        >> Good luck.
        >>
        >> Phil
        >>
        >> "vladp" <vladp@camba.or g> wrote in message
        >> news:OIE9VeMpFH A.2720@TK2MSFTN GP10.phx.gbl...[color=darkred]
        >>> Hi!
        >>> Here is problem I got.
        >>> I use vb.net and MSSQL Server 2000.
        >>> My dropdownlist box gets information from view, and it works. However
        >>> when I am trying to get information from the dropdownlist I get error
        >>> message.
        >>> Also during step by step debug dropPP.Selected Item.Text gets value
        >>> "NOTHING"
        >>>
        >>> Object reference not set to an instance of an object.
        >>> Description: An unhandled exception occurred during the execution of the
        >>> current web request. Please review the stack trace for more information
        >>> about the error and where it originated in the code.
        >>>
        >>> Exception Details: System.NullRefe renceException: Object reference not
        >>> set to an instance of an object.
        >>>
        >>> Source Error:
        >>>
        >>> Line 442: If txtPD.Text <> "" Then .Item("dept_cod e") =
        >>> txtPD.Text
        >>> Line 443: If txtEffort.Text <> "" Then .Item("effort") =
        >>> txtEffort.Text
        >>> Line 444: If dropPP.Selected Item.Text <> "" Then
        >>> .Item("dept_nam e") = dropPP.Selected Item.Text
        >>> Line 445: 'If dropBT.Selected Item.Text <> "" Then
        >>> .Item("budget_t itle") = dropBT.Selected Item.Text
        >>> Line 446: If txtStart.Text <> "" Then .Item("efft_dat e_from")
        >>> = txtStart.Text Else .Item("efft_dat e_from") = 0
        >>>
        >>>
        >>> Thanks.
        >>>
        >>> Vlad
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Cor Ligthert [MVP]

          #5
          Re: Need help

          Vlad,

          Did you see that the code in your message is almost unreadable. This gives
          you less change on help. The line numbers are by instance not important for
          us.
          [color=blue]
          > Line 442: If txtPD.Text <> "" Then .Item("dept_cod e") =
          > txtPD.Text[/color]
          while when here is not a 'Then' than is should give directly an error.

          As advice, if you want help, make it than as easy readable as can be.

          Cor


          Comment

          Working...