Microsoft KB Archive/818587

= FIX: Regression in dataset serialization in the .NET Framework 1.1 when a DataRow contains a RowError or a ColumnError property =

Article ID: 818587

Article Last Modified on 4/7/2006

-

APPLIES TO


 * Microsoft .NET Framework 1.1

-



SYMPTOMS
When you pass a dataset that contains a custom ColumnError property or a RowError property between a Web service and a client application, you receive the following exception error message:

System.InvalidOperationException: There is an error in XML document (1, 1216). ---> System.NullReferenceException: Object reference not set to an instance of an object.



RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.       Date         Time   Version            Size    File name --      27-Jun-2003  15:01  1.1.4322.918    1,294,336  System.data.dll 30-Jun-2003 22:27  1.0.0.0         1,629,352  Ndp1.1-kb823679-x86.exe 03-Jul-2003 03:20  5.3.17.17         709,920  Windowsserver2003-kb821415-x86-enu.exe Note You must restart your computer for the hotfix to take affect. For additional information about how to apply this hotfix, see the readme file that is included with this hotfix.



Steps to reproduce the behavior
  Create a Web service with the following Web Service method to return a dataset with the ColumnError or the RowError property set: [WebMethod] public DataSet Test {  // Build a dataset with one table and one field DataSet dataSet1 = new DataSet; dataSet1.Tables.Add(&quot;Table1&quot;); dataSet1.Tables[&quot;Table1&quot;].Columns.Add(&quot;Field1&quot;, Type.GetType(&quot;System.String&quot;));

// Add a row to the table dataSet1.Tables[&quot;Table1&quot;].Rows.Add(new object[] {&quot;Server Value&quot;}); // Uncomment the following to test ColumnError. // dataSet1.Tables[&quot;Table1&quot;].Rows[0].SetColumnError(&quot;Field1&quot;, &quot;Server Error Message&quot;);

// Uncomment the following to test RowError. // dataSet1.Tables[&quot;Table1&quot;].Rows[0].RowError = &quot;Server Error Message&quot;; // Send dataset back to the client return dataSet1; }  Create a console application, and then add the service that you created in step 1 as a Web Reference.  Paste the following code in the Main section: public static void Main {  try {     localhost.Service1 service1 = new localhost.Service1; // Get dataSet from the Web service System.Data.DataSet dsSer = service1.Test; }  catch (Exception exc) {        Console.WriteLine(exc); } } Note Replace  with the appropriate Web service namespace.  Compile and run the Web service. Compile and run the client application. The application throws the &quot;System.InvalidOperationException&quot; exception.

The exception stack
System.InvalidOperationException: There is an error in XML document (1, 1216). ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Xml.Serialization.XmlSerializationReader.UnknownNode(XmlNode unknownNode, Object o) at System.Xml.Serialization.XmlSerializationReader.UnknownNode(Object o) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read3_TestResponse --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader) at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Serialization.Client.localhost.Service1.Test(Boolean setColumnError) in c:\documents and settings\jreece\my documents\visual studio projects\serializationtest\serialization.client\web references\localhost\reference.cs:line 37 at Serialization.Client.Form1.button2_Click(Object sender, EventArgs e) in c:\documents and settings\jreece\my documents\visual studio projects\serializationtest\serialization.client\form1.cs:line 156

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbbug kbfix kbsystemdata kbqfe kbmanaged kbhotfixserver KB818587

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.