Click here to Skip to main content
12,698,253 members (23,226 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
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)
Posted 16-Nov-12 23:30pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100