ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Louwris, Wessel" <wessel.louw...@satama.com>
Subject System.InvalidProgramException: Common Language Runtime detected an invalid program on a QueryForObject
Date Mon, 25 Sep 2006 00:20:54 GMT
Hi,

I'm trying to to get ibatis for .Net 1.1 to work with a QueryForObject.
A QueryForObject which returns a int (select(count)) works
An Insert works, but the QueryForObject which should return the object
gives the following error message:


Exception Details: System.InvalidProgramException: Common Language
Runtime detected an invalid program.

Source Error: 

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.  

Stack Trace: 


[InvalidProgramException: Common Language Runtime detected an invalid
program.]
   SetForxsell.XsellRespondent2campaign.Set(Object , Object ) +0
 
IBatisNet.Common.Utilities.Objects.Members.EmitFieldSetAccessor.Set(Obje
ct target, Object value) +28
 
IBatisNet.DataMapper.DataExchange.DotNetObjectDataExchange.SetData(Objec
t& target, ResultProperty mapping, Object dataBaseValue) +111
 
IBatisNet.DataMapper.MappedStatements.PropertyStrategy.DefaultStrategy.S
et(RequestScope request, ResultMap resultMap, ResultProperty mapping,
Object& target, IDataReader reader, Object keys) +332
 
IBatisNet.DataMapper.MappedStatements.ResultStrategy.ResultMapStrategy.P
rocess(RequestScope request, IDataReader& reader, Object resultObject)
+306
 
IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(
RequestScope request, IDalSession session, Object parameterObject,
Object resultObject) +136
 
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObj
ect(IDalSession session, Object parameterObject, Object resultObject)
+88
 
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObj
ect(IDalSession session, Object parameterObject) +10
   IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName,
Object parameterObject) +146
   xsell.wwwroot.form.Page_Load(Object sender, EventArgs e) in
c:\projects\vod\xsell\wwwroot\form.aspx.cs:133
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750

 


My XsellRespondent2 class is like:
public class XsellRespondent2 
	{
		public string cust_id;
		public string campaign;
		public XsellRespondent2() {}
	}

with the table:
create table xsell_respondents2 ( 
campaign varchar(100),
cust_id varchar(100)
)


And the statement is:
	<resultMaps>
		<resultMap id="rSelectRespondent"
class="xsell.XsellRespondent2" >
			<result property="campaign" column="campaign" />
			<result property="cust_id" column="cust_id" />
		</resultMap>
	</resultMaps>

  <statements>    
    
    <select id="GetByCustId" resultMap="rSelectRespondent"
parameterClass="string" >    
		select campaign,cust_id from xsell_respondents where
cust_id=#cust_id#
	</select>
    
  </statements>
  
  

I have no clue how te debug this thing. I guess some sort of generated
piece of code gives problems.But I hope somebody can help me out here.

btw: the NPetshop.Web seems to work so apparently it can be done, and I
am doing something wrong. But I dunno what.
btw2: this is running on XP but a Server 2003 machine gives the same
results (mssql 2000).
Thanks a lot for any help. 

Wessel

Mime
View raw message