How to return the specific data result set

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tcflam
Posts: 62
Joined: Tue 01 Jan 2013 10:48

How to return the specific data result set

Post by tcflam » Sun 14 Jun 2020 13:01

Stored procedure returns 3 dataset. How to handle in TMSStoredProc? And could it return specific dataset in DBGrid? I'm using SDAC 9.2.4 and XE2

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: How to return the specific data result set

Post by Stellar » Mon 15 Jun 2020 11:02

You can skeep unused datasets by calling the OpenNext method method the respective number of times.

See our documentation for more information on opening subsequent datasets:
https://www.devart.com/sdac/docs/devart ... next().htm

tcflam
Posts: 62
Joined: Tue 01 Jan 2013 10:48

Re: How to return the specific data result set

Post by tcflam » Mon 15 Jun 2020 11:47

Thanks. I tested your suggestion. But how to using single TMSStoredProc to show different dataset into different DBGrid?

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: How to return the specific data result set

Post by Stellar » Fri 19 Jun 2020 05:24

TMSStoredProc can display only one dataset at a time. If you need to open multiple datasets simultaneously, you may try using the OpenDatasets method of TMSConnection, for example:

MSQuery1.SQL.Text := 'SELECT * FROM Dept';
MSQuery2.SQL.Text := 'SELECT * FROM Emp';

MSConnection1.OpenDatasets([MSQuery1, MSQuery2]);

See this page for more information on opening multiple datasets simultenously
https://www.devart.com/sdac/docs/devart ... set[]).htm

Post Reply