Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeerapuram Varadhan <v.varadhan@gmail.com>2010-04-10 03:31:49 +0400
committerVeerapuram Varadhan <v.varadhan@gmail.com>2010-04-10 03:31:49 +0400
commit16b1c946e1611437dbd15652d3dc7a8901912dc3 (patch)
treee971c3dfa045c23b79b11abe633893d8816eadd7
parent4664e5a6d171c644eefdcb0d2e9c45783b5c2920 (diff)
2010-04-09 Veerapuram Varadhan <vvaradhan@novell.com>
** Fixes #576520 - Based on a patch by Greg SIROU <gspam@secway.fr> * DataSet.cs (WriteColumnAsElement): Handle system.object types * sanely. svn path=/branches/mono-2-6/mcs/; revision=155179
-rw-r--r--mcs/class/System.Data/System.Data/ChangeLog5
-rw-r--r--mcs/class/System.Data/System.Data/DataSet.cs8
2 files changed, 11 insertions, 2 deletions
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
index f2871bbf424..218659b3794 100644
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ b/mcs/class/System.Data/System.Data/ChangeLog
@@ -1,5 +1,10 @@
2010-04-09 Veerapuram Varadhan <vvaradhan@novell.com>
+ ** Fixes #576520 - Based on a patch by Greg SIROU <gspam@secway.fr>
+ * DataSet.cs (WriteColumnAsElement): Handle system.object types sanely.
+
+2010-04-09 Veerapuram Varadhan <vvaradhan@novell.com>
+
** DataColumn.cs (Clone): Fix a typo - use the member directly
instead of get/set property.
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
index cb447a2c41c..b62aff1e4d7 100644
--- a/mcs/class/System.Data/System.Data/DataSet.cs
+++ b/mcs/class/System.Data/System.Data/DataSet.cs
@@ -1402,8 +1402,12 @@ namespace System.Data
//TODO check if I can get away with write element string
WriteStartElement (writer, mode, colnspc, col.Prefix, XmlHelper.Encode (col.ColumnName));
- if (typeof (IXmlSerializable).IsAssignableFrom (col.DataType)) {
- ((IXmlSerializable)rowObject).WriteXml (writer);
+ if (typeof (IXmlSerializable).IsAssignableFrom (col.DataType)
+ || col.DataType == typeof (object)) {
+ IXmlSerializable serializableObj = rowObject as IXmlSerializable;
+ if (serializableObj == null)
+ throw new InvalidOperationException ();
+ ((IXmlSerializable)rowObject).WriteXml (writer);
} else {
writer.WriteString (WriteObjectXml (rowObject));
}