Wiki Home

Stored Procedures And Ole DB

Namespace: WIN_COM_API
Q. How to return a result set from a VFP stored Procedure to .Net.

A. Use the VFP 9 SetResultSet() function.

Function GetCustomerCursor
lparameters lnCustID
Select * from Customer where lnCustomerID = lnCustID into cursor curCustomer
Return SetResultSet("curCustomer")

Prior to VFP 9, a stored procedure could return a value, but not a result set to .NET. This was severely limiting. By being able to return a result set, one can do data processing before returning the result set to .Net for display or consumption in a Data Set.

Thanks to Doug Henning for this tip.

( Topic last updated: 2005.03.23 10:13:47 PM )