http://community.youkuaiyun.com/Expert/topic/4491/4491201.xml?temp=.1365015
string xmlData1 ="<?xml version='1.0' encoding='utf-8' ?><E_table><E_title>我们来自天南地北</E_title><E_body>招眼红你好</E_body><E_name>小飞侠</E_name></E_table>";
//Transfer xml string to DataSet
DataSet xmlds=new DataSet();
string NewLine = System.Environment.NewLine;
string s = xmlData1.Replace(NewLine,"");
System.IO.StringReader reader = new System.IO.StringReader(s);
xmlds.ReadXml(reader as System.IO.TextReader);
reader.Close();
本文介绍了一种将XML格式的字符串转换为DataSet对象的方法。通过一个具体的示例展示了如何读取和解析XML数据,并将其转换为.NET Framework中的DataSet。此过程涉及XML字符串的预处理、使用StringReader进行读取以及调用DataSet的ReadXml方法。
1万+

被折叠的 条评论
为什么被折叠?



