I am a bit of a newbie to C# and would like help with the following.
I am bringing in a dataset and transforming that dataset using an XSL style sheet to generate text. This text does in fact contains SQL statements (DBCC commands etc) which I want to capture and run on a SQL Server instance. At the moment I can do this by writing the result of the transformation to file and re-loading it, but would like to skip out the file and write directly into a string. How do I acheive this?
Currently my code looks like this;
{load DataSet xmltestDS with relational data}
XmlDataDocument xmlDoc = new XmlDataDocument(xmltestDS);
XslTransform xslTran = new XslTransform();
xslTran.Load("C:\\XSLTTest.xsl");
XmlTextWriter writer = new XmlTextWriter("C:\\XSLTTest.txt", System.Text.Encoding.UTF8);
xslTran.Transform(xmlDoc, null, writer, null);
Thanks
Stuart