O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

The DataSet, DataTable, and DataColumn objects give me some flexibility in the structure of the XML document I create in the WriteXml method, but I need even more control. I want to add a processing instruction to my XML that references my XSL transformation. How do I do this?

A

You can use the XmlDataDocument object to access the contents of the DataSet as an XmlDocument. You set the EnforceConstraints property of the DataSet to False and then use the XmlDataDocument object to customize the structure of your XML document as you see fit. In this case, you can use the CreateProcessingInstruction method of the XmlDataDocument object, as shown in the following code snippet. Once you’re done, you call ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required