0

目前我有一个经典的 asp 应用程序,其中一个页面的逻辑如下:

SELECT * FROM Table1 WHERE Condition
//DO stuff
SELECT * FROM Table2 WHERE Condition
//DO stuff
SELECT * FROM Table3 WHERE Condition
//Execute

我需要将其转换为存储过程。现在我知道如何在 ASP 中使用存储过程,但是我不知道如何使用多选来做到这一点。如何生成三组数据并正确使用?

谢谢。

4

1 回答 1

1

Are you using ADO or ADO.Net ? Both have the capability to return multiple recordsets from a stored procedure. In Ado, if a stored procedure has multiple Selects in it, you can access the second, and subsequent Resultsets (ADO RecordSets) in your client code by calling Recordset.NextRecordSet.

In ADO.Net, When a Stored proc has multiple Selects, ADO.Net will put the results of each Select into a DataTable object, and put each DataTable into the Tables collection of the DataSet object which returned by the ADO.Net command.Execute() method.

于 2013-06-05T13:51:42.097 回答