问题描述
我有两个关于执行 SQL 任务生成的结果集的问题 -
I have two questions about the result set generated by an execute SQL task -
1) 存储结果集的对象的类是什么?是 ADODB 记录集吗?2)无论是什么对象,如何迭代该对象.我想简单地迭代它并以网格形式打印它,就像它出现在 SQL 服务器管理工作室中一样.我想在不将其放入 DataTable 对象或类似的东西的情况下执行此操作.那会浪费内存和时间.
1) What is the class of the object where the result set is stored ? Is it ADODB recordset ?2) Whatever object it is, how does one iterate that object. I want to simply iterate it an print it in grid form, just like it would appear in SQL server management studio. I want to do this WITHOUT putting it into a DataTable object or something like that. That would be a waste of memory and time.
有人可以告诉我怎么做吗?
Can someone show me how to do that ?
推荐答案
另一种方法是使用 ADO.NET 连接而不是 OLEDB.如果您使用 ADO.NET 连接,您将获得 ADO.NET DataSet 对象.DataSet 是 DataTable 的集合.
An alternative would be to use an ADO.NET connection instead of OLEDB. If you use ADO.NET connection, you will get ADO.NET DataSet object. A DataSet is a collection of DataTable.
DataSet 教程的一些链接 -
Some links for DataSet tutorials -
http://www.dotnetperls.com/dataset
斯科特·米切尔 (Scott Mitchell) 的嘘声 -
Scott Mitchell's tut -
http://msdn.microsoft.com/en-us/library/aa581776.aspx
这篇关于了解“完整结果集"SSIS的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!