Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6058649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:37:21+00:00 2026-05-23T08:37:21+00:00

I wrote an ASPX file in VB.NET. Originally this file ran successfully but after

  • 0

I wrote an ASPX file in VB.NET. Originally this file ran successfully but after adding one additional parameter it now fails on “Object reference not set to an instance of an object” on line “peType.DataSource = arrPEType” below.

This error does not make sense to me though because I have similar parameter, ‘dType’, which it does not error on. What is the cause of this error?

Here is some of my ASPX code file:

Sub Page_Load(Sender as Object, E as EventArgs)
    If Not IsPostback Then 

      Dim TheMonthDate As Date = DateAdd(DateInterval.Month, -1, Today)
      calStartDate.SelectedDate = CDate((TheMonthDate.Month) & "/1/" & Year(TheMonthDate)).ToString("MM/dd/yyyy")
      calEndDate.SelectedDate = GlobalFunctions.GlobalF.MonthLastDate(CDate((TheMonthDate.Month) & "/1/" & Year(TheMonthDate)).ToString("MM/dd/yyyy"))

      Dim arrType as New ArrayList()
      Dim arrOrgUnit as New ArrayList()
      Dim arrPEType as New ArrayList()
      Dim peType As ListBox

      arrType.Add("Product and Process")
      arrType.Add("Product")       
       arrType.Add("Process")             
      dType.DataSource = arrType
      dType.DataBind()

      arrPEType.Add("-INC")
      arrPEType.Add("-NC")
      arrPEType.Add("-QC")
      peType.DataSource = arrPEType
      'peType.DataTextField = "DisplayColumnName"
      'peType.DataValueField = "ValueColumnName"
      peType.DataBind()
...
      Dim TheType as String
      Dim TheOrgUnit as String
      Dim PE_Type as String

      Select Case dType.SelectedValue
        Case "Product and Process": 
          TheType = "((SMARTSOLVE.V_QXP_ALL_EXCEPTION.QXP_BASE_EXCEPTION)='PXP_PRODUCT_QXP' Or (SMARTSOLVE.V_QXP_ALL_EXCEPTION.QXP_BASE_EXCEPTION)='PXP_PROCESS_QXP')"
        Case "Product": 
          TheType = "((SMARTSOLVE.V_QXP_ALL_EXCEPTION.QXP_BASE_EXCEPTION)='PXP_PRODUCT_QXP')"
        Case "Process": 
          TheType = "((SMARTSOLVE.V_QXP_ALL_EXCEPTION.QXP_BASE_EXCEPTION)='PXP_PROCESS_QXP')"
      End Select

      Select Case peType.SelectedValue
        Case "INC": 
          PE_Type = "substring(a.QXP_EXCEPTION_NO, charindex('-', a.QXP_EXCEPTION_NO)+1, 4)='INC'"
        Case "NC": 
          PE_Type = "substring(a.QXP_EXCEPTION_NO, charindex('-', a.QXP_EXCEPTION_NO)+1, 4)='NC'"
        Case "QC": 
          PE_Type = "substring(a.QXP_EXCEPTION_NO, charindex('-', a.QXP_EXCEPTION_NO)+1, 4)='QC'"
      End Select
...
          <td>
            Product Exception Type:
          </td>
          <td>
            <ASP:DROPDOWNLIST ID="peType" RUNAT="Server" AUTOPOSTBACK="true" />
          </td>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:37:21+00:00Added an answer on May 23, 2026 at 8:37 am

    You’re not instantiating your ListBox, your simply declaring it.

    Dim peType As ListBox()
    

    …should be…

    Dim peType As New ListBox()
    

    Although the error may appear to be vague, it’s telling you the exact problem. Your object, peType, is not set to an instance of an object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

IIS enables us to also configure Asp.Net file mappings. Thus besides aspx, IIS also
I Need to make a webpage. asp.net this webpage recieve parameter by using Request.Querystring
I am relativity new to asp.net programming, so this one has me stumped. I
Suppose i have created one .js file name as: MyNoteBook.js. In this .js file
I wrote a simple batch file as a PowerShell script, and I am getting
I wrote an ASP.NET web application with an installer. For the installer, I'm using
I wrote a webservice by aspx in vs2008 and a windows applocation by c#
I am thinking about the asp.net 2.0 code behind model. After I drag a
Hi i using this article as my app base. https://blogs.msdn.com/hammett/archive/2009/04/23/mef-and-asp-net-mvc-sample.aspx In my UI.master file
What would you write as an absolut minimum to write a aspx file? The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.