i'm currently modifying a legacy application that uses the SqlHelper class in c#. how do you access the OUTPUT value using an executedatareader?
Asked
Active
Viewed 1,397 times
0
-
its an old DAAB class, i believe its this one: http://www.sharpdeveloper.net/source/SqlHelper-Source-Code-cs.html – Martin Ongtangco Sep 13 '10 at 01:37
1 Answers
1
You need to pass a SqlParameter
object with the correct name, then check the parameter's value after calling ExecuteDataReader
.

SLaks
- 868,454
- 176
- 1,908
- 1,964
-
but wouldn't that defeat the parameter caching? i'm asking because that's what i'm doing right now. – Martin Ongtangco Sep 13 '10 at 01:52
-
It does not make sense to cache output parameter as such. BTW, you have to indicate parameter's direction as output. – VinayC Sep 13 '10 at 07:05