Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Stored Procedure with two parameters
Message
De
12/10/2010 15:27:18
 
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01485066
Message ID:
01485080
Vues:
45
>>Hi,
>>
>>I'm trying to adapt this example code from the MM.NET help file to pass in two parameters, one is an input and one an output:
>>
>>
   // Create the parameter and set the direction
>>   IDbDataParameter param1 = this.CreateParameter("@result", 0);
>>   param1.Direction = ParameterDirection.Output;
>>
>>   // Call the stored procedure and pass the parameter
>>   IDbCommand cmd;
>>   this.ExecSprocScalar("OutputParamTest", out cmd, param1);
>>
>>   // Retrieve the value from the command object
>>   IDbDataParameter param = (IDbDataParameter)cmd.Parameters["@result"];
>>   int x = (int)param.Value;
>>
>>How do I pass the second parameter into
>>
>>
this.ExecSprocScalar("OutputParamTest", out cmd, param1);
?
>
>Just add a second parameter, e.g.
>
>
this.ExecSprocScalar("OutputParamTest", out cmd, param1, param2);
>
>I assume it should work - check overloads for this method - how many parameters does it accept.
>
>May be you'll need to pass parameters as a collection.

Sorry, the error I was getting was completely unrelated to this, passing in the two parameters was working.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform