In C# how to get return value from stored procedure using ExecuteNonQuery

前端 未结 8 1376
梦毁少年i
梦毁少年i 2020-12-06 07:03

I have the following query:

create proc [dbo].[DeleteParts] 
    @TransNo nvarchar (6), @fpart nvarchar(25) 
AS 
    DECLARE @Returns BIT 
    SET @Returns =         


        
相关标签:
8条回答
  • 2020-12-06 07:32

    I don't see that you are returning the value. Please add the Return statement to return any value from the stored proc.

    0 讨论(0)
  • 2020-12-06 07:38

    you must specify output type in stored procedures like this

    @IDout                  [int] output
    

    then add this parameter

    SPParamReturnCollection sp = new SPParamReturnCollection();
            sp.Add(new SPParams { Name = "IDout", ParamDirection = ParameterDirection.Output, Type = SqlDbType.Int });
    
    0 讨论(0)
提交回复
热议问题