CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Jan 2006
    Posts
    326

    [RESOLVED] Object reference not set to an instance of an object"

    Code:
                    StreamReader sr1 = new StreamReader(name1);
                    Dictionary<string, string> dictmap = new Dictionary<string, string>();
                    Dictionary<int, string>[] dictped = new Dictionary<int, string>[2];
                    int k = 0;
                    while (!sr1.EndOfStream)
                    {
                        string line = sr1.ReadLine();
                        string[] fields = line.Split('\t');
                        dictmap.Add(fields[1], line);
                        dictped[0].Add(k, fields[1]); // error here while step into
                        k += 1;
                    }
    But I got an error "Object reference not set to an instance of an object".
    Thanks for help.
    Resloved!
    Last edited by zhshqzyc; December 14th, 2010 at 11:31 AM.

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

Featured