Hi I am trying to access my XmlTextWriter class within a called method, but
am unable to do this. I have initiated the new class within the main method
static void Main
{
XmlTextWriter tw = new XmlTextWriter(fileName,null);
//lots more code including xml text writing calls
// i then call my method
MyMethod(text);
}
public static void MyMethod(string text)
{
tw.WriteStartElement("stuff goes here ect"); //this does not work
//more xml write stuff
}
How do i use my tw object everywhere?
Thanks for your help