Return Value from a Stored Procedure

后端 未结 2 859
不知归路
不知归路 2021-01-23 14:34

I am trying to get data returned from my stored procedure. This is what I have tried and absolutely nothing is coming back.

Stored Proc:

Declare @Submit_         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-23 15:13

    First add parameter to cmd and use .Value to its value

     cmd.Parameters.Add(pSub);    // add parameters to command
     cmd.ExecuteNonQuery();
     subid = Convert.ToInt32(pSub.Value); // Use .Value
    

提交回复
热议问题