.Net Tip: Console.Out
Shabat Shalom everyone!
The Problem
Sometimes you want your output to get written to the console and all you have is a method that receives a stream to output to. For example, DataSet.WriteXml gets different types of streams or a file path to write to...
The Solution
If you want to output the result to the screen, use Console.Out as your stream:
DataSet d = GetDataSetFromSomewhere();
d.WriteXml(Console.Out);
That's it!
All the best,
Shay.