hi, i'm a strage error when i execute my code...the excepiotn is this:
{"The type initializer for 'Ciclo.Data.NHibernate.DAOSession' threw an exception."}
my table:
RequestProfileProposal(ID,IDprofileRequest,IDConsultant,IDManager,InsertTime,Note,Available)
my store procedure:
ALTER PROCEDURE dbo.sp_provaNicola ( @IDConsultant INT = '428' ) AS
SELECT
IDConsultant AS consultant_id
FROM
RequestProfileProposal
WHERE
IDConsultant = @IDConsultant
my mapping file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Ciclo.Core" assembly="Ciclo.Core">
<class name="RequestProfileProposals" lazy="false" table="RequestProfileProposal">
<id name="ID" access="property" type="System.Int32">
<column name="ID" />
<generator class="native" />
</id>
<property name="IDProfileRequest" type="System.Int32"/>
<property name="IDConsultant" type="System.Int32"/>
<property name="IDManager" type="System.Int32"/>
<property name="InsertTime" type="System.DateTime"/>
<property name="Note" type="System.String"/>
<property name="Available" type="System.Boolean"/>
<sql-query name="sp_provaNicola">
<return-property name="IDConsultant" column="IDConsultant" >
</return-property>
exec sp_provaNicola :IDConsultant
</sql-query>
</class>
</hibernate-mapping>
my method:
public List<RequestProfileProposals> Sp_ProvaNicola_Method(int IDConsultant)
{
ISession session = DAOSession.BuildSessionFactory().OpenSession();
IQuery iQuery = session.GetNamedQuery("sp_provaNicola").SetInt32("IDConsultant", IDConsultant).SetResultTransformer(new global::NHibernate.Transform.AliasToBeanConstructorResultTransformer(typeof(RequestProfileProposals).GetConstructors()[0]));
session.Close();
return iQuery.List<RequestProfileProposals>() as List<RequestProfileProposals>;
}
Can someone help me?? tanks a lot..
|