The type or namespace name 'Text Reader' could not be found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • buterfly0707
    New Member
    • Nov 2009
    • 30

    The type or namespace name 'Text Reader' could not be found

    The type or namespace name 'Text Reader' could not be found (are you missing a using directive or an assembly reference?)" what dose this error mean??"
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Notice how all your code is contained within a namespace?
    Code:
    Namespace MyProgramApplication
    {
       public class Form1 : form
       {
          // Some code here for your form
       }
    }
    The compiler tried to figure out what your 'text reader' is supposed to be. Is it a namespace? Is it a type? The compiler failed to recognize it as either.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      System.IO.TextR eader

      You have to add a using statement to the top of your code to use a TextReader object.

      TextReader is part of the System.IO namespace, which is not included by default on most generated templates.

      Add this line of code at the top with all the other using statements:
      Code:
      using System.IO;

      Comment

      • buterfly0707
        New Member
        • Nov 2009
        • 30

        #4
        thank you it works now.

        Comment

        Working...