Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting value of OUTPUT param in .net
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01544303
Message ID:
01544306
Vues:
36
>Hi,
>
>I need to get the value of OUTPUT parameter passed to a SQL Server stored procedure from a C# method. The pseudo code is as following:
>
>
>// create array of parameters to pass to the stored proced
>string[,] Parameters = new string[,] { { "@Param1", cVal1, "" }, { "@Param2", cVal2, "" }, 
>{ "@Param3", cVal3, "" } };
>
>// call stored procedure:
>MyDataAccessClass.ExecuteStoredProcedure("MyStoredProcedure", Parameters);
>
>
>
>Note that the stored procedure will have OUTPUT set to parameter @Param3.
>
>My question is, after I execute the procedure above, will the variable @Param3 have the value the procedure will set to? That is, can I, after the procedure do the following:
>
>
>IF (@Param3 = 'SomeString)
>{
>    // code
>}
>
>
>My concern (question) is, can I (or should I) refer to the variable as @Param3 in the C# method?
>
>TIA.

The Parameters collection should have a value of the output parameter (don't forget to set direction InputOutput for it)

Parameters[2].Value
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform