Hello i have read a lot about this error in this forum but i can not use to answers to get a solution.
The database i use is from a customer with strange m:n relations in it. This is the first time for me i have to deal with a n:m relationship.
llblgen version = 2.5 final
the sql(2005 express)server script i use: see attachement
The code i use:
private static void ShowMailPiecesJob(XmlNodeList aMailPieceList, decimal aIdentityCommon) {
JobsEntity job = new JobsEntity();
IPredicateExpression filter = new PredicateExpression().Add(JobsFields.IdentityCommon.SetObjectAlias("JobsIdentityCommon") == aIdentityCommon);
MailPiecesCollection mailPieces = job.GetMultiMailPieces(true, filter);
foreach(MailPiecesEntity mailPiece in mailPieces){
Console.Write(mailPiece.JobsId.ToString());
}
}
The error i get:
31-1-2008 9:55:40:
SD.LLBLGen.Pro.ORMSupportClasses.NET20
An exception was caught during the execution of a retrieval query: The multi-part identifier "aIdentityCommon.IdentityCommon" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
An exception was caught during the execution of a retrieval query: The multi-part identifier "aIdentityCommon.IdentityCommon" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery, IFieldPersistenceInfo[] fieldPersistenceInfos)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, IPrefetchPath prefetchPathToUse, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at StaterDal.DaoClasses.MailPieceDAO.GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity jobInstance, Int32 pageNumber, Int32 pageSize) in C:\Stater\DAL\DaoClasses\MailPieceDAO.cs:line 77
at StaterDal.CollectionClasses.MailPieceCollection.GetMultiManyToOne(IEntity jobInstance, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicateExpression filter, Int32 pageNumber, Int32 pageSize) in C:\Stater\DAL\CollectionClasses\MailPieceCollection.cs:line 115
at StaterDal.CollectionClasses.MailPieceCollection.GetMultiManyToOne(IEntity jobInstance, IPredicateExpression filter) in C:\Stater\DAL\CollectionClasses\MailPieceCollection.cs:line 78
at StaterDal.EntityClasses.JobEntity.GetMultiMailPiece(Boolean forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter) in C:\Stater\DAL\EntityClasses\JobEntity.cs:line 446
at StaterDal.EntityClasses.JobEntity.GetMultiMailPiece(Boolean forceFetch, IPredicateExpression filter) in C:\Stater\DAL\EntityClasses\JobEntity.cs:line 413
at Stater.Program.SaveJobsMailPieces(XmlNodeList aMailPieceList, Decimal aIdentityCommon) in C:\Stater\Stater\Program.cs:line 52
at Stater.Program.Main(String[] args) in C:\Stater\Stater\Program.cs:line 41
I try to get the mailpieces with a give identityCommon.
I generated SelfServing classes.
Probably i make a beginner mistake i hope you know which one.
Thanx for reading this.
Jos
Attachments
Filename |
File size |
Added on |
Approval |
Stater.sql
|
4,496 |
31-Jan-2008 10:59.03 |
Approved |