Cannot insert or append joint array of stringbuilder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samira388
    New Member
    • Mar 2010
    • 2

    #1

    Cannot insert or append joint array of stringbuilder

    i can not insert or append in an array of stringbuilder element as well as a joint one that has the form
    stringbuilder [,] str=new stringbuilder[20,2];
    for an example
    and in every time i had an exception saying
    exception {"Object reference not set to an instance of an object."} System.Exceptio n {System.NullRef erenceException }
    i need a very fast solution please and thank you
    new member
    samira388
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Originally posted by OriginalPoster
    "How do I fix a 'object reference not set to an instance of an object' error?
    The line your code stopped on while debugging holds all your answers.
    One of the variables/objects was created but not initialized. For example:
    Code:
    string TempString;// Created but not initialized so this is still null
    //versus
    string TempString = string.empty;
    Debug your project again. This time, when it breaks on a line look at the Locals pallet to see which variable/object is null. You can also hover your mouse over each variable and the hothelp will shows its value. One of them will be null.

    Comment

    • samira388
      New Member
      • Mar 2010
      • 2

      #3
      thanks your answer helps me a lot

      Comment

      Working...