Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting value of OUTPUT param in .net
Message
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01544303
Message ID:
01544402
Views:
21
>>>
>>>Given your previous post I guess you no longer need it but, in pseudo-code:
SqlCommand command = new SqlCommand();
>>>            //Congfigure command
>>>            SqlParameter param = new SqlParameter(Parameters[2, 0], Parameters[2, 1]);
>>>            param.Direction = ParameterDirection.InputOutput;
>>>            //etc
>>>            command.Parameters.Add(param);
>>>            //Add other params , execute....
>>>            var v =  command.Parameters["@Param3"].Value;
>>
>>Can you think of why when I am trying to apply the above code, C# compiler complaints that 'object does not contain a definition for 'Value'". This is on the very last line where Parameters value is retrieved. And when I entry the open bracket key, right after the 'Parameters' Intellisense shows that object List parameter is int Index. What am I missing?
>
>Can you show the code you're trying?

The code is kind of long but the ending lines are pretty much as Viv has in his example. And it also pretty much the same as in the url you sent me yesterday (example of using output parameter and ExecuteNonQuery). The 'command' is command. The Parameters is collection of parameters. It must have something to do with the Parameters collection created prior to calling stored procedure.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform