I wish to receive some data from SqlServer as XML and write out result
to as a string.
Eg: cmd = new SqlCommand( "select * from blah for xml auto", con );
XmlReader result = cmd.ExecuteXmlReader( );
Console.Writeln( result.ToString( ) );
This XML is meant to be the input for an XSLT transform so I'm
interested in seeing the XML in a form similar to <row col1='blah'
col2='blah' />. The XML comes back ok, but I'm not sure how to convert
the XmlReader into a String in an efficient manner.
One way I know would be to load it into a dataset and then write out
as XML and another way would be to serialize / deserialize from an
object, but surely there is a simple way of converting the XmlReader
into a String.
Cheers Dave