Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. object reference not set to an instance of the object

object reference not set to an instance of the object

Scheduled Pinned Locked Moved C#
databasehelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TWatson47
    wrote on last edited by
    #1

    I am trying to pull data from a DB and have it prefill a form when the form is pulled up. Here is a little snippet of code that I am using. I am getting a handling error (in subject line) public static string[] FormArgs; public static DESClient.DESClientConnection conn; private DESClient.DESApplicant applicant; private string primedln = String.Empty; int x = 0; foreach(string arg in FormArgs) {switch( x ) {case 4: primedln = arg; break;} x += 1; } applicant = new DESClient.DESApplicant(conn); applicant.setAppID(Convert.ToInt32 (primedln) ); lbName.Text = applicant.getLname()+", "+ applicant.getFname()+" "+ applicant.getMname()+"."; lbDLN.Text = applicant.getAppId() +"/"+ address.getState().ToUpper(); static void Main(string[] args) { Form1.FormArgs = args; Application.Run(new Form1()); }

    J C 2 Replies Last reply
    0
    • T TWatson47

      I am trying to pull data from a DB and have it prefill a form when the form is pulled up. Here is a little snippet of code that I am using. I am getting a handling error (in subject line) public static string[] FormArgs; public static DESClient.DESClientConnection conn; private DESClient.DESApplicant applicant; private string primedln = String.Empty; int x = 0; foreach(string arg in FormArgs) {switch( x ) {case 4: primedln = arg; break;} x += 1; } applicant = new DESClient.DESApplicant(conn); applicant.setAppID(Convert.ToInt32 (primedln) ); lbName.Text = applicant.getLname()+", "+ applicant.getFname()+" "+ applicant.getMname()+"."; lbDLN.Text = applicant.getAppId() +"/"+ address.getState().ToUpper(); static void Main(string[] args) { Form1.FormArgs = args; Application.Run(new Form1()); }

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Which line is the error occurring in? I don't see a "subject line".

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: And in this corner, the Party of Allah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      T 1 Reply Last reply
      0
      • T TWatson47

        I am trying to pull data from a DB and have it prefill a form when the form is pulled up. Here is a little snippet of code that I am using. I am getting a handling error (in subject line) public static string[] FormArgs; public static DESClient.DESClientConnection conn; private DESClient.DESApplicant applicant; private string primedln = String.Empty; int x = 0; foreach(string arg in FormArgs) {switch( x ) {case 4: primedln = arg; break;} x += 1; } applicant = new DESClient.DESApplicant(conn); applicant.setAppID(Convert.ToInt32 (primedln) ); lbName.Text = applicant.getLname()+", "+ applicant.getFname()+" "+ applicant.getMname()+"."; lbDLN.Text = applicant.getAppId() +"/"+ address.getState().ToUpper(); static void Main(string[] args) { Form1.FormArgs = args; Application.Run(new Form1()); }

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        TWatson47 wrote:

        foreach(string arg in FormArgs) {switch( x ) {case 4: primedln = arg; break;} x += 1; }

        Why not just grab the fifth item by index ? You need to step into this code, and work out which line is causing the error.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        1 Reply Last reply
        0
        • J Judah Gabriel Himango

          Which line is the error occurring in? I don't see a "subject line".

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: And in this corner, the Party of Allah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          T Offline
          T Offline
          TWatson47
          wrote on last edited by
          #4

          lbDLN.Text = applicant.getAppId() +"/"+ address.getState().ToUpper();

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups