如何使用数据服务从存储过程中使用结果集? [英] How to use results set from a stored procedure using data service?

查看:125
本文介绍了如何使用数据服务从存储过程中使用结果集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过与EDM结合,客户端可以使用LINQ从EntitySet访问数据。
但是我想通过ADO.NET数据服务使用与EntitySet相同的存储过程的结果集。

例如,我有一个实体人员,而实体设置了人员集。然后我用一些参数写一个存储过程spGetPerson。字段可能与人表相同,也许不是。
如何将spGetPerson作为一个实体进行处理,以便我可以通过调用服务然后sp来获取客户端的数据?

如何实现此请求?

With the combination with EDM, client side can access data from EntitySet using LINQ.
But I want to use the result set from a stored procedure same as EntitySet through ADO.NET Data service.

For example, I have a entity people, and entity set peopleset.
Then I write a stored proc spGetPerson with some params. the fields maybe same as people table, maybe not.
How to treae spGetPerson  same as one entity, so that I can get the data at client side by call the service then the sp?

How to implement this request?

推荐答案

你可以通过在Ado .Net DataServices中实现"服务操作"来实现这一点。要了解有关它们的更多信息,请查看此白皮书: http://msdn.microsoft.com/en-我们/库/ cc907912.aspx 。如果您有任何疑问,请告诉我们。

感谢Pratik
YOu can do this by implementing 'Service Operations' in Ado .Net DataServices. TO find more about them, look at this white paper: http://msdn.microsoft.com/en-us/library/cc907912.aspx. Do let us know if you have any more questions.

Thanks
Pratik


这篇关于如何使用数据服务从存储过程中使用结果集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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