c# 4.0 - Calling stored procedure using Nhibernate named query -
i facing problem while calling procedure using named query in nhibernate.i have procedure accept 3 parameters, first 1 varchar(max) guid list, second varchar(50) , third 1 bit type.
i have using following procedure in c# using named query nhibernate
var customerbalance = session.getnamedquery("ar_tarcustomer_readaccount_forbalancedetail_new") .setparameter("customerlist", "'''bced443a-ce86-4675-bca6-ae5646ad9c2e'' , ''bced443a-ce86-4675-bca6-ae5646ad9c2e'''") .setparameter("asofdate", "10/1/2012") .setparameter("postedonly", postedonly) .setresulttransformer(new aliastobeanresulttransformer(typeof(tarcustomer))).list<tarcustomer>();
and following code .hbm.xml file
<sql-query name="ar_tarcustomer_readaccount_forbalancedetail_new" callable="true"> <!--<query-param name="customerlist" type="varchar(max)" /> <query-param name="asofdate" type="string" /> <query-param name="postedonly" type="bool" />--> <return class="tarcustomer"> </return> exec ar_tarcustomer_readaccount_forbalancedetail_new @customerlist=:customerlist, @asofdate=:asofdate, @postedonly=:postedonly </sql-query>
when debug code gives error "conversion failed character string uniqueidentifier"
when passed these same parameters in sql server runs successfully.
here in c#, had tried type of combination passing parameter procedure using nhibernate crased.
please me solve out problem stuck in problem last 3 days , it's urgent solve it.
i using c# language , nhibernate
Comments
Post a Comment