将 sqlcmd 输出获取到 GridView
我正在设计一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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().