很明显是productmap.xml文件里面的问题,语法错误,xml分析没有通过。
你点击“查看详细信息”,看看里面的innerexception属性,里面有更具体的信息。
目测这些地方逗号有误:#UName,dbType=VarChar#   改成: #UName:VarChar#看看

解决方案 »

  1.   

    楼上所说的配置非自己写的,而是从Codesmith生成的,难道真的是这里错了!我试一下!
      

  2.   

    试过了,还是不好使。查看详细错误发现如下:在解决方案中搜索未发现这个文件
    不知道这个ProductMap.xml这个是什么文件?有什么用。需要如何配置?放在项目的什么位置?
      

  3.   

    现在提示:未将对象引用设置到对象的实例,请问如何解决?
    TUser.xml如下:
    <?xml version="1.0" encoding="utf-8" ?>
    <!--============================================================================
    // CAUTION: This file is generated by IBatisNetGen.BatisMap.cst at 2014-10-22 13:59:11
    // Any manual editing will be lost in re-generation.
    //===========================================================================-->
    <sqlMap namespace="MyBatisDemo"
    xmlns="http://ibatis.apache.org/mapping"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     
      <alias>
        <typeAlias alias="TUser" type="MyBatisDemo.TUser" />
      </alias>  <resultMaps>
        <resultMap id="FullResultMap" class="TUser">
          <result property="UID" column="U_ID" dbType="Int"/>
          <result property="UName" column="U_Name" dbType="VarChar"/>
          <result property="UDept" column="U_Dept" dbType="VarChar"/>
        </resultMap>
      </resultMaps>  <statements>    <insert id="Insert_User" parameterClass="TUser">
          INSERT INTO [dbo].[T_USER] (
           [U_Name]
          , [U_Dept]
          ) VALUES (
          #UName#
          , #UDept#
          )
        </insert>
      </statements>
    </sqlMap>