Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want to write the stored procedure in C# with if loop.
if(icounter=1 && ivalue=2)
so how can i do it in C# in Strored procedure
Posted
Comments
OriginalGriff 22-Jan-11 4:24am    
"If" does not construct a loop - it is purely a conditional selection. Perhaps you mean "while"?
Michael Waguih 22-Jan-11 6:30am    
Can you describe what you need in more details ?
Shahin Khorshidnia 22-Jan-11 13:07pm    
Not a very good describing !

Do you mean Stored Procedure in SQL Server? if so then the only loop that I know is possible in T-SQL is while loop like this:

while(@icount=1 and @ivalue=2)
begin
'Your code here
end

Thanks
 
Share this answer
 
Hi Astika,

while(icount == 1 && ivalue == 2)
{
     //
     // YOUR CODE HERE
     //
}


I hope that help
Good luck :)
 
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