Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/MobileTimeTicket1' Application.
________________________________________
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 68: mycon1.Close()
Line 69: da.Dispose()
Line 70: jobno.DataSource = ds
Line 71: jobno.DataTextField = "job_no"
Line 72: jobno.DataValueField = "job_no"

Source File: C:\Inetpub\wwwroot\MobileTimeTicket1\TimeTicket.aspx.vb Line: 70

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
MobileTimeTicket1.TimeTicket1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\MobileTimeTicket1\TimeTicket.aspx.vb:70
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.MobileControls.MobilePage.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
Posted

1 solution

jobno is null - so when you try to retrieve jobno.DataSource it throws an exception.

You need to assign jobno to an instance (of whatever class it is declared as being), either with the New keyword, or by assigning an existing instance to it.
Since you code fragment doesn't show the declaration or any other uses, I can't be more specific.
 
Share this answer
 
Comments
nityasri 18-Nov-12 10:43am    
@griff..thank u
OriginalGriff 18-Nov-12 11:14am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900