Return-Path: Delivered-To: apmail-ibatis-user-cs-archive@www.apache.org Received: (qmail 10508 invoked from network); 25 Sep 2006 10:24:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Sep 2006 10:24:02 -0000 Received: (qmail 5034 invoked by uid 500); 25 Sep 2006 10:24:02 -0000 Delivered-To: apmail-ibatis-user-cs-archive@ibatis.apache.org Received: (qmail 4846 invoked by uid 500); 25 Sep 2006 10:24:01 -0000 Mailing-List: contact user-cs-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-cs@ibatis.apache.org Delivered-To: mailing list user-cs@ibatis.apache.org Received: (qmail 4835 invoked by uid 99); 25 Sep 2006 10:24:01 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Sep 2006 03:24:01 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=don.dwoske@gmail.com; spf=pass Authentication-Results: idunn.apache.osuosl.org header.from=don.dwoske@gmail.com; domainkeys=good X-ASF-Spam-Status: No, hits=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE Received-SPF: pass (idunn.apache.osuosl.org: domain gmail.com designates 64.233.166.181 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [64.233.166.181] ([64.233.166.181:8329] helo=py-out-1112.google.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 34/91-13750-F3EA7154 for ; Mon, 25 Sep 2006 03:23:59 -0700 Received: by py-out-1112.google.com with SMTP id b29so2400567pya for ; Mon, 25 Sep 2006 03:23:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=LzscQRXo+1qQHXORW2XQpnnzWyZpmFpUZxiygrLIq8c4Y/QnWLHKmhocDMrT0T/ggUo959o/XXdDhnp4eR1RE5yl/caHaqhYlCJeTRnJCpAmQ4xQTwuthz9bX12Um71fV33F7H60V2XDfEx71TO6noG1TNnZANCFrizHYP68IpI= Received: by 10.35.72.1 with SMTP id z1mr8029871pyk; Mon, 25 Sep 2006 03:23:56 -0700 (PDT) Received: by 10.35.89.20 with HTTP; Mon, 25 Sep 2006 03:23:55 -0700 (PDT) Message-ID: <41fde74d0609250323t5d6d2b89q2f438fa52167d6fc@mail.gmail.com> Date: Mon, 25 Sep 2006 06:23:56 -0400 From: "Don Dwoske" Sender: don.dwoske@gmail.com To: user-cs@ibatis.apache.org Subject: Re: System.InvalidProgramException: Common Language Runtime detected an invalid program on a QueryForObject In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 7d866a4c7acb744d X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is the bug I found last week (I believe). Look back in the board for my message about using public fields. I included source code for the change which you would have to make in your own local copy (I compiled the source on my own to debug and find this) - I'm too busy to submit a bug report with a test case and patch right now...maybe someone else with free time can look at my message and do that to get this change incorporated into the code base. I'm a newbie with C# and also generated code, so I'm not confident what I did is even makes sense - but it works - so that's all I care about. To fix your code so that it works with the existing code base - use properties with getters and setters and not public fields. -Don On 9/24/06, Louwris, Wessel wrote: > 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: > > class="xsell.XsellRespondent2" > > > > > > > > > > > > > > > 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 > -- --------------------------------------- Donald Dwoske Software Journeyman http://www.loraxis.com/ddwoske