Browse Source

2004-03-18 Atsushi Enomoto <[email protected]>

	* XmlDataDocument.cs : Fixed incorrect cast in OnDataTableRowAdded().
	  This fixes bug #54505.

svn path=/trunk/mcs/; revision=24279
Atsushi Eno 22 years ago
parent
commit
d4e180ee69

+ 5 - 0
mcs/class/System.Data/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2004-03-18  Atsushi Enomoto <[email protected]>
+
+	* XmlDataDocument.cs : Fixed incorrect cast in OnDataTableRowAdded().
+	  This fixes bug #54505.
+
 2003-07-31  Duncan Mak  <[email protected]>
 
 	* XmlDataDocument.cs (BaseURI):

+ 2 - 1
mcs/class/System.Data/System.Xml/XmlDataDocument.cs

@@ -556,7 +556,8 @@ namespace System.Xml {
 			for (int i = 0; i < row.Table.Columns.Count; i++) {
 
 				rowElement = CreateElement (row.Table.Columns [i].ColumnName);
-				rowElement.InnerText = (string)row [i];
+				object v = row [i];
+				rowElement.InnerText = v != null ? v.ToString () : String.Empty;
 				element.AppendChild (rowElement);
 			}