如何将字符串变量读入XML,再读到DATASET
1个回答
展开全部
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();
//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();
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询