I hope someone can help me.
I am using iBatis.Net with VB.Net (required by the client, otherwise I
would be using C#)
It seems like no matter what namespace I am using in my VS project, I
can't get the typeAlias to work.
I keep on getting the error "could not load type" in nUnit
com.roanoketime.forecasters.data.test_Forecaster.GetData :
IBatisNet.Common.Exceptions.ConfigurationException :
- The error occurred while loading SqlMap.
- initialize type alias
- The error occurred in <sqlMap resource="../data/Forecaster.xml"
xmlns="http://ibatis.apache.org/dataMapper" />.
- Check the com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data.
----> System.TypeLoadException : Could not load type :
com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data
Here is my xml:
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap
namespace="xmlmap_Forecaster"
xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd"
>
<alias>
<typeAlias alias="test"
type="com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data" />
</alias>
<statements>
<select id="Select" parameterClass="string" >
SELECT
RTUserID,
FirstName,
LastName
FROM
Forecaster
</select>
</statements>
</sqlMap>
Here is how I am testing it in VB.NET:
Dim ilUsers As IList =
IBatisNet.DataMapper.Mapper.Instance().QueryForList("Select", "test")
I love how people almost feel a need to apologize for using VB :-)
For your question, check the assembly default namespace (in VS project
properties), that could be a cause.
Alex
________________________________
From: Douglas Smith [mailto:douglas.smith@aciwebs.com]
Sent: Wednesday, July 19, 2006 3:18 PM
To: user-cs@ibatis.apache.org
Subject: iBatis Newbie: Problem with <typeAlias
I hope someone can help me.
I am using iBatis.Net with VB.Net (required by the client, otherwise I
would be using C#)
It seems like no matter what namespace I am using in my VS project, I
can't get the typeAlias to work.
I keep on getting the error "could not load type" in nUnit
com.roanoketime.forecasters.data.test_Forecaster.GetData :
IBatisNet.Common.Exceptions.ConfigurationException :
- The error occurred while loading SqlMap.
- initialize type alias
- The error occurred in <sqlMap resource="../data/Forecaster.xml"
xmlns="http://ibatis.apache.org/dataMapper" />.
- Check the com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data.
----> System.TypeLoadException : Could not load type :
com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data
Here is my xml:
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap
namespace="xmlmap_Forecaster"
xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd"
>
<alias>
<typeAlias alias="test"
type="com.roanoketimes.forecasters.data.Forecaster,
com.roanoketimes.forecasters.data" />
</alias>
<statements>
<select id="Select" parameterClass="string" >
SELECT
RTUserID,
FirstName,
LastName
FROM
Forecaster
</select>
</statements>
</sqlMap>
Here is how I am testing it in VB.NET:
Dim ilUsers As IList =
IBatisNet.DataMapper.Mapper.Instance().QueryForList("Select", "test")