如何使用带有两个select语句的单个存储过程将结果绑定到两个不同的datalist [英] how to bind results to two different datalist using single stored procedure with two select statements

查看:108
本文介绍了如何使用带有两个select语句的单个存储过程将结果绑定到两个不同的datalist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







i写入存储过程,下面有两个选择语句





ALTER程序[dbo]。[数据]

@companyname nvarchar(50),

@countryid int,

@location nvarchar(50)

as

begin



select distinct top 8 (LocationName),CompanyName,Count(LocationName)as JobCount from Job其中(CompanyName = @ companyname)group by LocationName,CompanyName按位置排序desc





从Job中选择不同的前8名(CompanyName),LocationName,Count(CompanyName)作为CompanyCount,其中(LocationName = @ location)按位置分组,CompanyName按CompanyCount排序desc







结束















单程序现在我想绑定它两个不同的datalist,怎么能我用linq(entityframework)来做

Hi,


i written stored procedure with two select statements as below


ALTER procedure [dbo].[data]
@companyname nvarchar(50),
@countryid int,
@location nvarchar(50)
as
begin

select distinct top 8 (LocationName) ,CompanyName ,Count(LocationName) as LocationCount from Job where( CompanyName=@companyname ) group by LocationName,CompanyName Order by LocationCount desc


select distinct top 8 (CompanyName),LocationName,Count(CompanyName) as CompanyCount from Job where( LocationName=@location ) group by LocationName,CompanyName Order by CompanyCount desc



end







in single procedure now i want to bind it two different datalist,how can i do it using linq(entityframework)

推荐答案

这篇关于如何使用带有两个select语句的单个存储过程将结果绑定到两个不同的datalist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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