GetXml() Output Looking Better Already
Posted in Development
Remember we talked about DataSet.GetXml() and its ugly formatting when dumped in the Immediate Window within Visual Studio.NET 2003 and 2005? My coworker, Ronnie, figured that Debug.Write ([DataSet].GetXml()), added to your code, prints it quite nicely in the output window.
Upon further tweaking, I discovered you can type the following in the Immediate Window (when in debug mode) and get the same nicely formatted XML document:
?System.Diagnostics.Debug.WriteLine ([DataSet].GetXml ())
The only drawback is that a dubious line, “Expression has been evaluated and has no value”, is appended to the output, but it’s a minor issue.
I still expect this bug fixed in VS.NET 2005!

Zubin Girglani
on November 1, 2007
The WriteLine method is a subroutine rather than a function and therefore no value is returned. Placing the question mark before this line in the immediate window implies that a value is to be returned and outputted to the immediate window, which in this case is not true. What you want to do is type the line leaving out the question mark and the 'Expression has been evaluated and has no value' message will disappear.