日期:2014-05-18  浏览次数:20722 次

ibatisnet用vs2005调试出现的问题
http://www.cnblogs.com/erichzhou/archive/2007/04/06/702773.html
根据上述链接做的一个ibatisnet的测试,用vs2005运行时提示错误:

-   The   error   occurred   while   loading   SqlMap.
-   The   error   occurred   in   <sqlMap   resource= "Person.xml "   xmlns= "http://ibatis.apache.org/dataMapper "   /> .
-----------------------
附:
sqlmap.config:
<?xml   version= "1.0 "   encoding= "utf-8 "   ?>

<sqlMapConfig   xmlns= "http://ibatis.apache.org/dataMapper "  
                            xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance ">

    <settings>
        <setting   cacheModelsEnabled= "true "/>
        <setting   useStatementNamespaces= "false "   />
    </settings>

    <providers   resource= "providers.config "   />

    <database>
        <provider   name= "sqlServer1.1 "> </provider>
        <dataSource   name= "IBatisNet "   connectionString= "Data   Source=127.0.0.1;Initial   Catalog=IBatisDemo;User   ID=sa "/>
    </database>
   
    <sqlMaps>
        <sqlMap   resource= "Person.xml "   />
    </sqlMaps>

</sqlMapConfig>
-----------------------
Person.xml:
<?xml   version= "1.0 "   encoding= "utf-8 "   ?>
<sqlMap   namespace= "IBatisNet.QuickStart "   xmlns= "http://ibatis.apache.org/datamapper "                  
                xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance "   >
   
  <alias>
        <typeAlias   alias= "Person "   type= "IBatisNet.QuickStart.Person,IBatisNet.QuickStart "   />
</alias>

<statements>
    <select   id= "SelectAll "   resultMap= "SelectAllResult ">
        select
        PersonID,
        PersonName,
        PersonAddress,
        CreateDate
        from   Persons
    </select>

    <insert   id= "InsertPerson "   parameterClass= "Person ">
        INSERT   INTO   Persons(
        [PersonName],[PersonAddress],[CreateDate]
        )VALUES(
        #PersonName#,#PersonAddress#,#CreateDate#
        )
    </insert>
</statements>
   
<resultMaps   >
    <resultMap   id= "SelectAllResult "   class= "Person ">
        <