C#中的存储过程 [英] Stored Procedure in C#

查看:105
本文介绍了C#中的存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想将参数传递给具有多个值的存储过程.
表示我有一个参数发布,其值可能是"inspector","police","Talati".
我希望选择所有该成员,我该怎么做!
请帮助

谢谢,
astika

解决方案

将所有这些值插入一个表中,说"temp",并说"post"列.
然后使用以下查询:

 选择 NameOfSamitiMember,Mobile,Post
来自 tblSamiti
其中 tblSamiti.VillageId=@VillageId
     and 中发布( select 发​​布来自临时)


参考:
将逗号分隔的参数传递给存储过程 [ ^ ]


hiii,


阅读这篇文章

存储过程中的数组参数处理 [ ^ ]

Hi ,

I wants to pass parameter to stored procedure which have multiple values.
means i have one parameter post and its value may be "inspector","police","Talati".
I wish to select all that member ,how can i do it!
Plz help

Thanks,
astika

解决方案

insert all these values in one table, say "temp", and say column "post"..

And then use following query:

select NameOfSamitiMember,Mobile,Post
from tblSamiti
where tblSamiti.VillageId=@VillageId
    and Post in (select post from temp)


Refer:
Passing an Array of Values to a Stored Procedure in SQL Server 2005[^]
Passing a Comma Delimited Parameter to a Stored Procedure[^]


hiii,


read this article

Array Parameter Handling in a Stored Procedure[^]


这篇关于C#中的存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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