将 sqlcmd 输出获取到 GridView

发布于 2024-07-09 08:13:00 字数 173 浏览 7 评论 0原文

我正在设计一个 ASP.NET 网站,它将运行 sqlcmd,获取一些输出并将其放入屏幕上的网格中。

我想知道是否有一种方法可以将 sqlcmd 的查询结果读取为我可以使用的某种格式,XML,DataSet 等。sqlcmd

中是否有一个友好的开关,可以以良好的格式输出它,或者将还得我自己解析?

I am designing an ASP.NET website that will run sqlcmd, get some output and put this into a grid on screen.

I was wondering if there is a method for reading the results of a query from sqlcmd into some kind of format that I can work with, XML, DataSet etc.

Is there a friendly switch in sqlcmd that will output it in a nice format or will I have to parse it myself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

薯片软お妹 2024-07-16 08:13:00

您可以使用 SqlCommand.ExecuteXmlReader() 函数。 它将返回 XmlReader 类型的对象。

此处可能无法提供关于 ExecuteXmlReader() 的帮助。

You can use the SqlCommand.ExecuteXmlReader() function. It will return the object of type XmlReader.

You may get little help here about ExecuteXmlReader().

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