DataSet.WriteXml Method (String, XmlWriteMode)
Assembly: System.Data (in system.data.dll)
The file name (including the path) to which to write.
One of the XmlWriteMode values.
The WriteXml method provides a way to write either data only, or both data and schema from a DataSet into an XML document, whereas the WriteXmlSchema method writes only the schema. To write both data and schema, set the mode parameter to WriteSchema.
Note that the same is true for the ReadXml and ReadXmlSchema methods, respectively. To read XML data, or both schema and data into the DataSet, use the ReadXml method. To read just the schema, use the ReadXmlSchema method.
The following example uses the WriteXml method to write an XML document.
- FileIOPermission for reading and writing files. Associated enumeration: FileIOPermissionAccess
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.