Command.ExecuteNonquery()
when am trying to execute a stored proc by using command.executenonquery() it was giving me the return value as -1, where I have to get 1 value. In the stored proc am doing inserting and updating , am inserting the orderid from order table into orderevent table(which has a trigger on orderevent table) and updating the status of an order in order table, please if anyone knows the solution let me know . Thanks in advance
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Kunal VaishyaRank #990 · 2K reputationPosted Apr 21, 2014, 10:03 PM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 21, 2014, 11:44 PM EDT
hi,
it might, your store procedure has no return value.
you can specify the return value using return keyword
Like
Create proc #testsp
as
begin
insert into #temp values(1)
return 0
end
hope this will help you.