Thanks greatly to amitgajjar for this solution.
This solution use the in-built
property. Since in my situation I am running this as a website and so multiple
s may exist, I used a static method to create all my
s and assign to their
property the static
I wanted to use for the log. The code looked as follows:
public static class DatabaseHandler
public static System.IO.StringWriter LogStream = new System.IO.StringWriter();
internal static DatabaseDataContext CreateDatabaseContext()
DatabaseDataContext TheContext = new DatabaseDataContext();
TheContext.Log = LogStream;
And then I had an aspx page that simply set it's ouput to type "text" and did
to get the log.
This is a very efficient and neat solution, thanks so much again to amitgajjar.
Hope this helps anyone else in need,