Article ID: 317961 - Last Review: March 9, 2006 - Revision: 1.2 A field that contains only NULL values is not copied into a new DataSet when you use the GetXml method to copy data from one DataSet to another DataSetThis article was previously published under Q317961 On This PageSYMPTOMS
When you use the GetXml method to copy data from one DataSet object to another, if any of the fields in the original DataSet contain only NULL (DbNull) values, these fields are not copied into the new DataSet.
CAUSE
This problem occurs because the DataSet.GetXml method does not include schema information. If you use another DataSet to read this output, the DataSet depends on the InferSchema value to recover schema information. However, because all of the values in the column are NULL, the column is absent from the GetXml output, and InferSchema cannot recover this column information. For additional information about why attributes are not generated for fields that contain a NULL value, click the article number below to view the article in the Microsoft Knowledge Base: 296393
(http://support.microsoft.com/kb/296393/EN-US/
)
PRB: Attributes Are Not Generated for Fields That Contain a NULL Value When ADO Recordset Is Persisted in XML
RESOLUTION
To resolve this problem, use the Copy method instead of the GetXml method. Microsoft recommends that you use the Copy method because the Copy method does not convert the DataSet to Extensible Markup Language (XML) and back.
STATUSThis behavior is by design. MORE INFORMATIONSteps to Reproduce the Behavior
REFERENCESFor additional information about how to write and how to read XML data from a DataSet, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
308064
(http://support.microsoft.com/kb/308064/EN-US/
)
HOW TO: Persist an ADO.NET DataSet as XML by Using Visual Basic .NET
309702
(http://support.microsoft.com/kb/309702/EN-US/
)
HOW TO: Read XML Data into a DataSet by Using Visual Basic .NET
For additional information about ADO.NET, click the article number below
to view the article in the Microsoft Knowledge Base:
313590
(http://support.microsoft.com/kb/313590/EN-US/
)
INFO: Roadmap for ADO.NET
| Article Translations
|

Back to the top
