Hi
I want to call the Stored procedure from My nHibernate Application thats stored Procedure return the List and i will return back to the UI How to call the SP can any one help me on this?
Hi
I want to call the Stored procedure from My nHibernate Application thats stored Procedure return the List and i will return back to the UI How to call the SP can any one help me on this?
You can use the following example. In you mapping file define the query
<sql-query name="MyNameQuery">
<return-scalar column="SomeColumn" type="String"/>
<![CDATA[exec proc_MyProc ?]]>
</sql-query>
For the call you can do following
ISQLQuery objQuery = MySession.GetNamedQuery("MyNameQuery") as ISQLQuery;
objQuery.SetParameter(0, "1"); // stored procedure expects a parameter, not used here
var myResult = objQuery.List<string>();