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 6069243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:48:05+00:00 2026-05-23T09:48:05+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 “Name ‘peType’ is not declared”.

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>

But now my error is:
Object reference not set to an instance of an object

  • 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-23T09:48:06+00:00Added an answer on May 23, 2026 at 9:48 am

    You missed setting the DataTextField and DataValueField property, when you tried to bind DataSource to your Dropdownlist, so set as follows:

    peType.DataSource = arrPEType
    peType.DataTextField = "DisplayColumnName"
    peType.DataValueField = "ValueColumnName"
    peType.DataBind()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote an ASPX file in VB.NET. Originally this file ran successfully but after
I just wrote this into my WebForms .aspx: <span id=GenerateChartButton runat=server></span> I went to
IIS enables us to also configure Asp.Net file mappings. Thus besides aspx, IIS also
I am developing a VB.NET ASPX file in VS 2008. I am having trouble
When I'm editing an aspx file in Visual Studio, Intellisense is always wrong after
Suppose i have created one .js file name as: MyNoteBook.js. In this .js file
I am relativity new to asp.net programming, so this one has me stumped. I
I wrote a simple batch file as a PowerShell script, and I am getting
I wrote a webservice by aspx in vs2008 and a windows applocation by c#
I have an ASP.Net GridView control on an ASPX page hosted on a SharePoint

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.