How to pass multiple value from code behind to sql server
How to pass multiple value from code behind to sql server (IN Operator)
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi ShekharPosted Apr 25, 2013, 12:38 AM
string branchnames="Branch001, Branch002, Branch003";
select * from table where branch in ('"+branchnames+"')
It gives a proper result which u want.
please mark it as answer . If you happy with above answer.
Regards,\
Ravi
Ravi ShekharPosted Apr 25, 2013, 1:13 AM
Please mark it as answer. If you r happy with the given code.
Jagatpal SinghPosted Apr 25, 2013, 1:11 AM
Ravikumar GPosted Apr 24, 2013, 11:25 PM
Jagatpal SinghPosted Apr 24, 2013, 1:43 PM
I have 3 values in my .cs page. I want to fetch data against these values from SQL Table using IN Operator
------Code Behind (.cs)------
Branch001, Branch002, Branch003
-----SQL Server (Store Procedure)-----
Declare @Branch nvarchar(max)
Select Company, Address,
Where Branch in (@Branch)
----How to pass 3 values to sql server using IN Operator
Pankaj RawatPosted Apr 24, 2013, 6:33 AM
Ravikumar GPosted Apr 24, 2013, 6:25 AM