string s_xml = @"<?xml version=\"1.0\" encoding=\"gb2312\"?><item><name>wrench</name></item>";
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.LoadXml(s_xml);
System.Console.WriteLine(xmlDoc.DataSet.GetXml());
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.LoadXml(s_xml);
System.Console.WriteLine(xmlDoc.DataSet.GetXml());
"
XmlDataDocument
...
To load a DataSet with XML data, use ReadXmlSchema to build a relational mapping. The XML data can then be loaded using Load or LoadXml.
..."
看看是不是你的XMl內容的錯誤
to saucer(思归):
能不能说的细些,或者告诉我文档的位置, 谢谢了
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconsynchronizingdatasetwithxmldatadocument.asp
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.DataSet.ReadXml(new StringReader(s_xml));
System.Console.WriteLine(xmlDoc.DataSet.GetXml());