My SP calls over to another DB to return a username string...in a single line of code how can I just extract that value to display?
1 Answer, 1 is accepted
0
Serge
Telerik team
answered on 09 Sep 2010, 03:46 PM
Hello Steve,
In this scenario you can use an output parameter for retrieving this value. More information on how to handle output parameters with OpenAccess Classic you can find in this help article. If you are using the new domain model however, you will need to do a small modification of the generated code.
If you for example have reverse mapped a Northwind database with the domain model in you context class you will have a method for each procedure. Lets have a look at this one:
If say the CategoryName parameter was an out parameter this would not work, as a matter of fact there is a small glitch in the code generation of the context class that we have fixed but is not released. What we would need to do to make it work is copy paste this method into a partial class of the context class and modify the declaration of the parameterCategoryName to :
While this will work, it seems rather troublesome as you need to modify both your stored procedure and code. Unfortunately there is no simple way of return a single value from a stored procedure.
Maybe retrieving the QueryResult and parsing it by hand is the better choice here.
I do hope this helps.
Greetings,
Serge
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items