Why don't you paste the stack trace (or at least the important parts of it).
You don't need to call OpenConnection before you use QueryForObject in the code
below:
ISqlMapper mapper = Mapper.Get();
mapper.OpenConnection();
Person per = (Person)mapper.QueryForObject("select-Person-ById", "P001");
This is wrong:
<resultMap id="PersonResultMapping" class="Person">
<result property="id_" column="id" type="string" dbType="varchar"/>
<result property="name_.firstname_" column="firstname" type="String"
dbType="varchar"/>
<result property="name_.lastname_" column="lastname" type="String"
dbType="varchar"/>
<result property="age_" column="age" type="int" dbType="int"/>
</resultMap>
It should be something like:
<resultMap id="PersonResultMapping" class="Person">
<result property="Id" column="id" type="string" dbType="varchar"/>
<result property="Name.FirstName" column="firstname" type="String"
dbType="varchar"/>
<result property="Name.LastName" column="lastname" type="String"
dbType="varchar"/>
<result property="Age" column="age" type="int" dbType="int"/>
</resultMap>
----- Original Message ----
From: Zheng WANG <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, June 19, 2007 10:54:07 AM
Subject: problem of constructor
Hi everyone,
I really have a problem with ibatis.net. It the message error :
“PersoIBatis.Person..ctor()” I don’t understand at all!!!!!! I will be crazy!
Is there someone can help me? I send you my code and sql query. (This’s no
virus, I just want help.)
If you haven’t problem with my code, please tell me too. I will find the
problem in somewhere else, the VS, the framework, I don’t know …..
Thank you very much.