How to use OUTPUT parameter in Stored Procedure

后端 未结 5 496
青春惊慌失措
青春惊慌失措 2020-12-18 05:21

I am new to writing Stored Procedure. So I wrote one with output parameters and want to access the output value, hot to do it.

My Stored Procedure:

A         


        
5条回答
  •  再見小時候
    2020-12-18 06:02

    You need to close the connection before you can use the output parameters. Something like this

    con.Close();
    MessageBox.Show(cmd.Parameters["@code"].Value.ToString());
    

提交回复
热议问题