You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Mark Babcock <ma...@geeksoncall.com> on 2005/11/17 22:33:44 UTC
Error Mesage
I could use some help. I'm trying to get some samples up and running
with IBATIS.Net and I would really appreciate some help.
ERROR: This SQL map does not contain a MappedStatement named
SelectAllTest
MAPS/WorkOrder.xml
<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="Account"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMap.xsd">
<alias>
<typeAlias alias="WorkOrder" type="ibatistest.WorkOrderImpl,
ibatistest" />
</alias>
<resultMap id="SelectAllResult" class="WorkOrder">
<result property="WorkOrder" column="WorkOrder" />
<result property="Account" column="Accont" />
</resultMap>
<select id="SelectAllTest" reslutMap="SelectAllResult">
select workdorder,account from workorder
</select>
</sqlMap>
sqlMap.config
<?xml version="1.0" encoding="utf-8" ?>
<sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">
<properties resource="properties.config" />
<settings>
<setting useStatementNamespaces="false" />
<setting cacheModelsEnabled="false" />
</settings>
<database>
<provider name="sqlServer1.1" />
<dataSource name="IBatisTest" connectionString="data
source=REPSERV;database=${database};user
id=${username};password=${password};"/>
</database>
<sqlMaps>
<sqlMap resource="Maps/WorkOrder.xml" />
</sqlMaps>
</sqlMapConfig>
Web form code behind
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using IBatisNet.DataMapper;
using IBatisNet.DataAccess;
using IBatisNet.DataMapper.Configuration;
namespace ibatistest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
//IList test =
Mapper.Instance().QueryForList("SelectAllTest",null);
IList test =
Mapper.Instance().QueryForList("SelectAllTest",null);
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web
Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}