Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling stored procedure using Nhibernate named query
    primarykey
    data
    text
    <p>I am facing a problem while calling procedure using named query in nhibernate. I have a procedure which accept three parameters, first one is varchar(max) which is actually a guid list, second is varchar(50) and third one is bit type.</p> <p>I have using following procedure in C# using named query Nhibernate</p> <pre><code> 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&lt;tARCustomer&gt;(); </code></pre> <p>And following code is for .hbm.xml file </p> <pre><code>&lt;sql-query name="ar_tARCustomer_ReadAccount_ForBalanceDetail_New" callable="true"&gt; &lt;!--&lt;query-param name="CustomerList" type="VARCHAR(max)" /&gt; &lt;query-param name="AsOfDate" type="string" /&gt; &lt;query-param name="PostedOnly" type="bool" /&gt;--&gt; &lt;return class="tARCustomer"&gt; &lt;/return&gt; exec ar_tARCustomer_ReadAccount_ForBalanceDetail_New @CustomerList=:CustomerList, @AsOfDate=:AsOfDate, @PostedOnly=:PostedOnly &lt;/sql-query&gt; </code></pre> <p>When I debug the code it gives error:</p> <blockquote> <p>Conversion failed to character string to uniqueidentifier</p> </blockquote> <p>When I passed these same parameters in sql server it runs successfully.</p> <p>Here in C#, I had tried all type of combination for passing parameter to procedure using NHibernate but it always crashed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload