6

Does anyone know if NHibernate supports returning output parameters from stored procedures? I've had a search in the documentation but can't really find anything that confirms either way.

2 Answers 2

7

I was facing the same problem. NHibernate does not let you use stored procedures in this manner. But it does allow a way to make calls using the plain old ADO.NET API. Here's an example -

http://refactoringaspnet.blogspot.com/2009/06/how-to-use-legacy-stored-procedures-in.html

Sign up to request clarification or add additional context in comments.

Comments

3

I can't officially confirm for you, but as far as I know, not directly. Stored procedure use in NHibernate is very specific to doing standard CRUD.

If you want to grab output paramaters (that are't the standard row count output parameter for INSERT, UPDATE, and DELETE), you could fall back to a different (or the standard) database access tools that give you direct access to SQL and the result set. (Assuming you can get by with bypassing NHibernate's cache. You'll want to make sure you flush NHibernate before you run the query too, etc.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.