Using the output of an SP

  •  

     

      Salutations all,

     

    I was wondering... .... how would one display an output parameter from a stored procedure? I mean, if I'm using C# to write the front-end of an application which uses a SQL database, how do I store the output parameter--in the case of my SP, of type varchar--as a string variable? Any help much appreciated.

  • In your C# you define your sqlparameter in exactly the same way as you would any other parameter but parameter.direction =ParameterDirection.Output.

    You datatypes match those being submitted to the procedure. So if your parameter is an SQL int then use c# int, if it is SQL varchar then use string, SQL BIT = c# bool etc.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply