FieldCompareSetPredicate in predicate causing exception

Posts   
 
    
imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 26-May-2010 22:30:02   

I am using following predicate in my code

predicate.Add(new FieldCompareSetPredicate( ResultsMappingFields.Id, null, ResultMappingsForPersonFields.MappingId, null,
                SetOperator.In, (ResultMappingsForPersonFields.personID == personID)));

but it causing "Index was outside the bounds of the array."exception with following stack trace. If I remove this predicate, every thing works fine. Any idea what I may be doing wrong?


   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Boolean relationsSpecified, Boolean sortClausesSpecified)
   at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause)
   at SD.LLBLGen.Pro.DQE.SqlServer.SqlServerSpecificCreator.CreateSubQuery(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldPersistenceInfos, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, IGroupByCollection groupByClause, Boolean allowDuplicates, Int32& uniqueMarker)
   at SD.LLBLGen.Pro.ORMSupportClasses.DbSpecificCreatorBase.CreateSubQuery(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldPersistenceInfos, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, IGroupByCollection groupByClause, Int32& uniqueMarker)
   at SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareSetPredicate.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
   at SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
   at SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker, Boolean inHavingClause)
   at SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression.ToQueryText(Int32& uniqueMarker)
   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Boolean relationsSpecified, Boolean sortClausesSpecified)
   at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause)
   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreatePagingSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFields selectList, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.CreateQueryFromElements(ITransaction transactionToUse, IEntityFields fields, IPredicate filter, IRelationCollection relations, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IGroupByCollection groupByClause, Boolean allowDuplicates, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAsDataTableAction(IEntityFields fieldsToReturn, DataTable tableToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Boolean allowDuplicates, IGroupByCollection groupByClause, ITransaction transactionToUse, Int32 pageNumber, Int32 pageSize)
   at EMR.DataAbstraction.DaoClasses.TypedListDAO.GetMultiAsDataTable(IEntityFields fieldsToReturn, DataTable tableToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Boolean allowDuplicates, IGroupByCollection groupByClause, ITransaction transactionToUse, Int32 pageNumber, Int32 pageSize) in C:\SandBox\EMR_Advantage\branches\3.2-Devel\Business Layer\EMR_DAL\DaoClasses\TypedListDAO.cs:line 49
   at EA.Controls.frmViewVitals.loadTabsForGroups(Guid patientId)
   at Notes.ctlVitals.ShowFrmVitals(Guid groupID) in C:\SandBox\EMR_Advantage\branches\3.2-Devel\icare2.0\tablet_CS\ctlVitals.cs:line 506
   at Notes.ctlVitals.cmdPulse_Click(Object sender, EventArgs e) in C:\SandBox\EMR_Advantage\branches\3.2-Devel\icare2.0\tablet_CS\ctlVitals.cs:line 527
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-May-2010 05:40:30   

is that the real code? Strange ResultMappingsForPersonFields.personID is not in pascal casing.

LLBLGen version and runtime library version?

David Elizondo | LLBLGen Support Team
imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 27-May-2010 14:55:23   

Well I just changed field names from the real code and its what happen when you trying to seek help in hurry simple_smile

LLBL Gen Pro 2.6 Final .NET 3.5 not sure if its helps but its Self Servicing

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 27-May-2010 22:24:31   

Please can you post the real, complete code ? We need to see what you are doing.

Matt

imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 28-May-2010 18:54:24   

ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(ExamResultsMappingFields.Id, 0);
fields.DefineField(ExamResultsMappingFields.MappingName, 1);
IPredicateExpression predicate = new PredicateExpression();
predicate.Add(ExamResultsMappingFields.Enable == 1);
predicate.AddWithOr(new FieldCompareSetPredicate(ExamResultsMappingFields.Id, null, ExamResultsMappingForStudentFields.MappingId, null,  SetOperator.In, (ExamResultsMappingForStudentFields.StudentId == StudentId)));

SortExpression sorter = new SortExpression(ExamResultsMappingFields.MappingName | SortOperator.Ascending);
TypedListDAO dao = new TypedListDAO();
DataTable dtResultMapping = new DataTable();
            dao.GetMultiAsDataTable(fields, dtResultMapping, 0, sorter, predicate, null, true, null, null, 0, 0);

If I replace null in GetMultiAsDataTable call for predicate, I don't get any exception

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 29-May-2010 05:20:59   

I cant reproduce your problem. Are you using the latest runtime library version? If not please update it and try again.

David Elizondo | LLBLGen Support Team
imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 31-May-2010 15:19:26   

Do you mean latest .NET runtime library or is it about LLBL libraries?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-May-2010 15:53:31   

LLBLGen runtime library version number (build no). Please check this link: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725

imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 31-May-2010 16:13:36   

From the about box of designer

LLBL version 2.6 Final Release on June 6th, 2008

From the properties of SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll

2.6.8.723

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-May-2010 16:18:29   

2.6.8.723

That's almost 2 years old, would you please download and try the latest available version.