FindMatches runtime exception

Posts   
 
    
banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 08-Jul-2008 11:43:08   

Hi

I have a problem with FindMatches. I get a runtime exception with the text "Object must be of type Int32", when running the line

_group1Indexes = _group2colorList.FindMatches(group1filter)

Here is the relevant code:


 private List<int> _group1Indexes = new List<int>();
 PredicateExpression group1filter = new PredicateExpression();
ListInterval l1 = new ListInterval();
l1.Add(_groupfilter.Group1Interval, new Char[] { ',' });
for (int i = 0; i < l1.Count; i++)
{
  group1filter.AddWithOr(new FieldBetweenPredicate(PakkelisteHistorikFields.Varenr, null, 
  1[i].Start, l1[i].End));
}
RelationPredicateBucket group2relationfilter = new RelationPredicateBucket();
group2relationfilter.PredicateExpression.Add(group2filter);
adapter.FetchEntityCollection(_group2colorList, group2relationfilter);
_group1Indexes = _group2colorList.FindMatches(group1filter);

group2filter is also a filter on varenr and some other details, which are don't know is relevant at the moment.

So what is wrong?

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 08-Jul-2008 12:32:27   

Please post the stack trace, and the LLBLGen Pro runtime library version used.

banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 08-Jul-2008 12:40:23   

The runtime version of SD.LLBLGen.Pro.ORMSupportClasses.NET20 is v2.0.50727

mscorlib.dll!int.CompareTo(object value) + 0x85 bytes   
mscorlib.dll!System.Collections.Comparer.Compare(object a, object b) + 0x78 bytes   
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.FieldBetweenPredicate.InterpretPredicate(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore entity = {FlyListe.DAL.EntityClasses.PakkelisteHistorikEntity}) + 0xff bytes  
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.Predicate.SD.LLBLGen.Pro.ORMSupportClasses.IPredicateInterpret.Interpret(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore entity = {FlyListe.DAL.EntityClasses.PakkelisteHistorikEntity}) + 0x1e bytes  
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.InterpretPredicate(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore entity = {FlyListe.DAL.EntityClasses.PakkelisteHistorikEntity}) + 0x1fc bytes   
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.Predicate.SD.LLBLGen.Pro.ORMSupportClasses.IPredicateInterpret.Interpret(SD.LLBLGen.Pro.ORMSupportClasses.IEntityCore entity = {FlyListe.DAL.EntityClasses.PakkelisteHistorikEntity}) + 0x1e bytes  
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll!SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore<FlyListe.DAL.EntityClasses.PakkelisteHistorikEntity>.FindMatches(SD.LLBLGen.Pro.ORMSupportClasses.IPredicate filter = {SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression}) + 0x122 bytes  

FlyListeWin.exe!FlyListeWin.FlyListeEdit.LoadData() Line 267 + 0x14 bytes C# FlyListeWin.exe!FlyListeWin.FlyListeEdit.RefreshData() Line 372 + 0x7 bytes C# FlyListeWin.exe!FlyListeWin.FlyListeEdit._groupFilterlinkLabel_LinkClicked(object sender = {System.Windows.Forms.LinkLabel, Text: Gruppefilter}, System.Windows.Forms.LinkLabelLinkClickedEventArgs e = {System.Windows.Forms.LinkLabelLinkClickedEventArgs}) Line 1120 + 0x8 bytes C# System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnLinkClicked(System.Windows.Forms.LinkLabelLinkClickedEventArgs e) + 0x6a bytes System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnMouseUp(System.Windows.Forms.MouseEventArgs e = {X = 37 Y = 8 Button = Left}) + 0x160 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0x2f7 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x526 bytes System.Windows.Forms.dll!System.Windows.Forms.Label.WndProc(ref System.Windows.Forms.Message m) + 0x34 bytes System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.WndProc(ref System.Windows.Forms.Message msg) + 0x13 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 514, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes [Native to Managed Transition] [Managed to Native Transition] System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x2f1 bytes System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes FlyListeWin.exe!FlyListeWin.Program.Main() Line 17 + 0x1a bytes C# [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x39 bytes Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x3b bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x40 bytes

Attachments
Filename File size Added on Approval
callstack.txt 4,733 08-Jul-2008 12:40.48 Approved
Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 08-Jul-2008 16:14:18   

group1filter.AddWithOr(new FieldBetweenPredicate(PakkelisteHistorikFields.Varenr, null, 1[i].Start, l1[i].End));

Looks like the predicate had problems executing the compare. Seems like the dataType of the field "Varenr" inside the PakkelisteHistorikEntity.

I guess that it's dataType can't be compared to l1[i].Start or 1[i].End

btw: v2.0.50727 is not a correct runtime library version, please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725

banusi
User
Posts: 43
Joined: 08-Jul-2006
# Posted on: 08-Jul-2008 17:28:12   

thanks a lot. The datatype for varenr is int in sql server 2005 and start, end is a string in my class.

It works fine when using the two filters for FetchEntityCollection, but not for the find method.

I will try to change the data type for start and end.

If it works I will thank you 100 times.

So the error message is correct from lllbgen. Again llblgen is number one.

The funny thing is that the filters are so compliated, that I can't figure out to write it in sql (I only show you part of the code)smile

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 08-Jul-2008 17:34:35   

No need to thank me, that's my job. Wish you figure it out.

I'll close this thread for now, till further notice from you. (Just reply and it will be re-opened automatically)