FIX: DataSet does not load the original records of DiffGram correctly (319919)
The information in this article applies to:
- Microsoft ADO.NET (included with the .NET Framework)
- Microsoft Visual Studio .NET (2002), Professional Edition
This article was previously published under Q319919 SYMPTOMS Under the following circumstances
- A modified DataSet is persisted to Extensible Markup Language (XML) as a DiffGram.
-and-
- You bind a DataGrid to the DataView object that is retrieved from the DataTable object. -and-
- You set the DataView.RowStateFilter property to ModifiedOriginal.
you receive the following error message:
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll
Additional information: Object reference not
set to an instance of an object. The same behavior occurs when you
use the Select method of a DataTable object if you set the DataViewRowState property to ModifiedCurrent, OriginalRows, or Deleted. CAUSE When the original records in the DiffGram are loaded into
the DataSet, correct indexes for the row versions are not created. As a
result, you cannot use any original records in indexing operations.
When you set the RowStateFilter property, the Error property of the DataRowView is accessed. This property accesses the "row" member variable,
which is set to null. As a result, you receive a NullReferenceException
exception. RESOLUTION To work around this problem, call the DataSet.Copy method to copy the DataSet that is loaded from the XML DiffGram. You can then successfully
set the DataViewRowState of the new DataSet to ModifiedOriginal. For more information about how to do this, see the steps in the
"More Information" section. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
This bug was corrected in Microsoft ADO.NET (included with
the .NET Framework 1.1), and Microsoft Visual Studio .NET (2003), Professional
Edition.
REFERENCESFor
additional information about XML integration with ADO.NET, click the article
number below to view the article in the Microsoft Knowledge Base: 313649 INFO: Roadmap for XML Integration with ADO.NET
For
additional information about XML schemas in the .NET Framework, click the
article number below to view the article in the Microsoft Knowledge Base: 313826 INFO: Roadmap for XML Schemas in the .NET Framework
Modification Type: | Minor | Last Reviewed: | 9/15/2005 |
---|
Keywords: | kbvs2002sp1sweep kbfix kbbug kbpending KB319919 |
---|
|