listboxes

S

somersbar

im trying to transfer data from a listbox to a textbox. my listbox
contains a few values from an access database that im linked to. but
when i try and select a value from the listbox and transfer it to the
textbox in the 'ListBox1_SelectedIndexChanged' function i get the
following error from line 94:

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 92:
Line 93: Private Sub ListBox1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ListBox1.SelectedIndexChanged
Line 94: TextBox1.Text = ListBox1.SelectedItem.Text
Line 95: 'Dim areaName As String = Session("areaName")
Line 96: 'areaName = ListBox1.SelectedItem.Text


Source File: c:\inetpub\wwwroot\CinemaBookingSystem\WebForm1.aspx.vb
Line: 94

any help appreciated.
 

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

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top