Need help

  • Thread starter Thread starter vladp
  • Start date Start date
V

vladp

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.SelectedItem.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.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

Line 442: If txtPD.Text <> "" Then .Item("dept_code") =
txtPD.Text
Line 443: If txtEffort.Text <> "" Then .Item("effort") =
txtEffort.Text
Line 444: If dropPP.SelectedItem.Text <> "" Then
..Item("dept_name") = dropPP.SelectedItem.Text
Line 445: 'If dropBT.SelectedItem.Text <> "" Then
..Item("budget_title") = dropBT.SelectedItem.Text
Line 446: If txtStart.Text <> "" Then .Item("efft_date_from") =
txtStart.Text Else .Item("efft_date_from") = 0


Thanks.

Vlad
 
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
 
It is getting lost.
Thanks
Phil G. said:
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
 
Have you included in your Page directive about viewstate? If not, add this
in your html code (top line):-

<%Page enableViewState="true" %>

Rgds, Phil
 
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.
Line 442: If txtPD.Text <> "" Then .Item("dept_code") =
txtPD.Text
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top