将SQL SP中的多个结果返回到数据集中 [英] Return multiple result in a SQL SP into a dataset(s)

查看:137
本文介绍了将SQL SP中的多个结果返回到数据集中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我需要在我的SQL数据库中对存储的proc进行两次选择。


At此刻,每个SP都被调用,并且填充了两个不同的数据集。

这是两次到SQL服务器的往返。


我可以将两个SP合并到一起一个,并有一个SP执行两个选择

语句,并有效地返回两个结果集,我可以从我的VB调用这个

一次到SQL服务器app。


只有问题是处理SQL返回的两个结果集

我的VB应用程序。


dataadapter或其他一些VB datacontrol可以处理这个,给我两个数据集吗?


谢谢

解决方案

*" AussieRules" <所以***** @ nowhere.com> scripsit:

我需要在我的SQL数据库中对存储的proc进行两次选择。

目前,每个SP都被调用并且有两个不同的数据集这是两次到SQL服务器的往返。

我可以将两个SP组合成一个,并有一个SP执行两个Select
语句,并有效地返回两个结果集,我可以从我的VB应用程序中一次访问SQL服务器来调用它。

然后只有问题是处理SQL返回的两个结果集
我的VB应用程序。

数据适配器或其他一些VB datacontrol可以处理这个,并给我两个数据集吗?




ADO.NET小组:


< news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>


Web界面:


< http://msdn.microsoft.com/newsgroups/default.asp?url = / newsgroups / loadframes.asp?icp = msdn& slcid =美国和放大器;新闻组=麦克风roso ft.public.dotnet.framework.adonet>


-

Herfried K. Wagner

MVP·VB Classic, VB.NET

< http://www.mvps.org/dotnet>


" AussieRules" <所以***** @ nowhere.com> schrieb

我需要在我的SQL
db中对存储的proc进行两次选择。

目前,每个SP都被调用并且
填充两个不同的数据集。这是SQL服务器的两次往返。

我可以将两个SP组合成一个,并且有一个SP执行两个选择语句,并且有效地返回两个结果集,并且我<可以从我的VB应用程序一次访问SQL服务器来调用它。

然后只有问题是处理SQL返回到我的VB应用程序的两个结果集。 />
dataadapter或其他一些VB datacontrol可以处理这个,并且
给我两个数据集吗?




有一个ADO .NET组:

microsoft.public.dotnet.framework.adonet

-

Armin


嘿,先生旅游指南,


我喜欢你的新制服,它比你的其他人更好

穿着。


;-))

问候,

Fergus

Hi,

I have a need to do two selects against to stored proc''s in my SQL db.

At the moment, each SP is called and two different dataset are populate.
Thats two round trips to the SQL server.

I can combine the two SP into one, and have one SP that executes two Select
Statements, and effectivly returns two result sets, and I could call this
with one trip to the SQL server from my VB app.

Only problem is then handling the two result sets that SQL is returning to
my VB app.

Can the dataadapter, or some other VB datacontrol handle this, and give me
both datasets ?

Thanks

解决方案

* "AussieRules" <so*****@nowhere.com> scripsit:

I have a need to do two selects against to stored proc''s in my SQL db.

At the moment, each SP is called and two different dataset are populate.
Thats two round trips to the SQL server.

I can combine the two SP into one, and have one SP that executes two Select
Statements, and effectivly returns two result sets, and I could call this
with one trip to the SQL server from my VB app.

Only problem is then handling the two result sets that SQL is returning to
my VB app.

Can the dataadapter, or some other VB datacontrol handle this, and give me
both datasets ?



ADO.NET group:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.adonet>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


"AussieRules" <so*****@nowhere.com> schrieb

I have a need to do two selects against to stored proc''s in my SQL
db.

At the moment, each SP is called and two different dataset are
populate. Thats two round trips to the SQL server.

I can combine the two SP into one, and have one SP that executes two
Select Statements, and effectivly returns two result sets, and I
could call this with one trip to the SQL server from my VB app.

Only problem is then handling the two result sets that SQL is
returning to my VB app.

Can the dataadapter, or some other VB datacontrol handle this, and
give me both datasets ?



There''s an ADO.NET group:
microsoft.public.dotnet.framework.adonet
--
Armin


Hey Mr Tourist Guide,

I like your new uniform, it''s much nicer than that other one you were
wearing.

;-))

Regards,
Fergus


这篇关于将SQL SP中的多个结果返回到数据集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆