Show/Hide Toolbars

Navigation: Advanced topics > Programming topics

ASPRunnerPro32x32     ASPRunnerPro manual


How to display data returned by stored procedure

Scroll Prev Next More

How to display data returned by stored procedure

The following stored procedure example returns data from the "test" table. It should be created in the in the SQL Server.

 

CREATE PROCEDURE [dbo].[test_proc]
AS
BEGIN
SET NOCOUNT ON;
SELECT * from test
END

 

1. Add 'test' table or any other table to the project

 

2. Add the following code to List page: CustomQuery event:

 

Set ListQuery=DB_Query( "EXEC test_proc" )

 

3. Add the following code to List page: FetchRecords event:

 

doAssignmentByRef ListFetchArray,rs.fetchAssoc()

 
4. Add the following code to ListGetRowCount event

 

doAssignmentByRef ListGetRowCount, tDAL.DBLookup("select count(*) from test")

 

See also

DB_Query

ListFetchArray

fetchAssoc

How to execute stored procedures