Results 1 to 3 of 3

Thread: Null Reference Exception Unhandled

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2008
    Posts
    28

    Unhappy Null Reference Exception Unhandled

    I am getting the above error from the following code

    fileWriter.WriteLine( _
    record.strFirstName & "," & record.strLastName & "," & _
    record.strStudentId & "," & record.strCourseName & "," & _
    record.strGrade)

    I am not exactly sure why.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Null Reference Exception Unhandled

    There isn't enough there to be certain, but the most likely answer is that fileWriter has not been instantiated. Next most likely is that record has not been instantiated. To find out which, you can highlight any piece and press Shif+F9 to look for the item that is Nothing.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2008
    Posts
    28

    Smile Re: Null Reference Exception Unhandled

    I figured out what I was doing wrong I had to create the file for this code to work. Thanks
    for all your replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width