tags:

views:

110

answers:

1

I have this class:

public static class CsvWriter
    {
       private static StreamWriter _writer = new StreamWriter(@"c:\temp\ssis_list.csv");

       public static  StreamWriter Writer 
       {
          get { return _writer; }
       }
    }

This is being called from another class

 class Program
  {
     ...
     static void GetConnections(string path,string pkgname,string server)
        {

          _writer.WriteLine(myLine);
        }
   }

Which has this error

The name '_writer' does not exist in the current context

How can I fix this?

+11  A: 

You want CsvWriter.Writer.WriteLine.

John Saunders