将 XMLDocument 转换为数据集 ASP.Net 1.1

发布于 2024-07-15 11:54:46 字数 72 浏览 5 评论 0原文

我需要将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余厌 2024-07-22 11:54:46

您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文