将 XMLDocument 转换为数据集 ASP.Net 1.1
我需要将 XMLDocument 转换为 ASP.Net 中的 DataSet。 我不想将 XMLData 保存到任何物理位置。
I need to convert XMLDocument to DataSet in ASP.Net. I do not want To Save the XMLData to any physical location.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 xmlDocument 类读取 xml 文件并将数据保存到数据集。 这里有一个示例,介绍如何使用 xmlDocument 读取 XML 文件。
这段代码很旧了。 没试过
XmlDocument xdoc = MethodReturnsXmlDocument();
// 转换为数据集
DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(xdoc));
这里是另一个示例。
You can use xmlDocument class to read the xml file and save the data to dataset. Here is an example about how you can use xmlDocument to read XML files.
This code is pretty old. Havent tried it
XmlDocument xdoc = MethodReturnsXmlDocument();
// convert to DataSet
DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(xdoc));
Here is another example for you.