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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ravi ShekharRank #673 · 3.6K reputationPosted Apr 24, 2013, 8:38 PM EDT
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
Ravikumar G178 reputationPosted Apr 24, 2013, 2:25 AM EDT
Pankaj Rawat71 reputationPosted Apr 24, 2013, 2:33 AM EDT
Jagatpal SinghRank #1,947 · 751 reputationPosted Apr 24, 2013, 9:43 AM EDT
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
Ravikumar G178 reputationPosted Apr 24, 2013, 7:25 PM EDT
Jagatpal SinghRank #1,947 · 751 reputationPosted Apr 24, 2013, 9:11 PM EDT
Ravi ShekharRank #673 · 3.6K reputationPosted Apr 24, 2013, 9:13 PM EDT
Please mark it as answer. If you r happy with the given code.