Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a Stored Procedure with Output Parameter
Message
 
 
À
27/06/2010 21:56:25
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01470620
Message ID:
01470744
Vues:
28
>>>Bonnie, you are a jewel.
>>>
>>>I had used AddWithValue on in that example because I was trying to follow the example Naomi showed. However, I did not know about using ParameterDirection.InputOutput. Thanks a bunch, I am going to dig into the MM code now to figure out if there is something different that is needed to keep it working there.
>>>
>>>Thanks again.
>>>Tim
>>>
>>
>>Tim,
>>
>>You were not attentive to details. That example only used AddWithValue for the input parameter (@Category). For the output parameter it used Add method.
>
>
>Yes, I know Naomi, but I used it as the first and only parameter in my case. I am not a SQL guru so was following your example by using it for the first example. Can you fill me in on the difference between AddWithValue and just Adding a parameter? I assumed they were the same except one included setting the value. Maybe I was wrong and probably is the case considering the issue.
>Thanks
>Tim

For the Output parameters you need to provide all details (type and length). This is only possible with Add method, not a quickie AddWithValue.

Also, you should try avoiding AddWithValue in the actual code. It's much better to always be 100% explicit and therefore use Add method. AddWithValue is only used because its syntax is simpler and easier to remember.
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