Click here to Skip to main content
15,910,886 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
am writing a web service.....In that , my stored procedure will return no.of rows of values...i need to collect all those values in .net...i should not use sqldataadapter....how can i do that????

if it is single row value, i am getting my result
C#
strFriend_ID = Convert.ToString(objGet_Post_Wall_Handler.Parameters["@APF_FRIEND_ID"].Value);


objGet_Post_Wall_Handler is my object for dbcommand.


if["@APF_FRIEND_ID"] returns many number of values, i need to store all those values, how can i do that????
Posted
Updated 26-Dec-11 23:08pm
v2
Comments
idhris2011 27-Dec-11 5:30am    
SET @APF_FRIEND_ID=(SELECT APF_FRIEND_ID FROM AS_PM_TBL_POST_WALL_HANDLER WHERE APR_PL_ID=@APR_PL_ID)

the above query can store one row value......
how can i have multiple rows of values....?
Dinesh Mani 29-Dec-11 0:09am    
First off, what is the limitation to using a data adapter???
Next, Why do you assign a value form a query to a variable, when APF_PL_ID can have more than one APF_FRIENT_ID associated with it???

1 solution

in store procedure you have to create a temp table and in temp table you to have to get all the row .


Sample code..

create table #temp
{
  APF_FRIEND_ID int
}

insert into #temp
SELECT APF_FRIEND_ID FROM AS_PM_TBL_POST_WALL_HANDLER WHERE APR_PL_ID=@APR_PL_ID


you can get all the row from the #temp table
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900