Error message

Posts   
 
    
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 13-Jul-2006 15:27:48   

Hello all,

Has anyone any indication of why this error might be thrown, I am using basic data binding to filter a standard entity.

Server Error in '/FEDOTNET' Application.

An exception was caught during the execution of a retrieval query: The multi-part identifier "fedge.dbo.t_Mortgage.status" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: The multi-part identifier "fedge.dbo.t_Mortgage.status" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.

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:

[ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: The multi-part identifier "fedge.dbo.t_Mortgage.status" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.] SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) +215 SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery) +422 SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Int32 pageNumber, Int32 pageSize) +271 SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, IPrefetchPath prefetchPathToUse) +97 SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicate selectFilter, IRelationCollection relations, IPrefetchPath prefetchPathToUse, Int32 pageNumber, Int32 pageSize) +66 SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase1.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, IPrefetchPath prefetchPathToUse, Int32 pageNumber, Int32 pageSize) +110 SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase1.SD.LLBLGen.Pro.ORMSupportClasses. IEntityCollection.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, IPrefetchPath prefetchPathToUse, Int32 pageNumber, Int32 pageSize) +29 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView.ExecuteSelectEntityCollection(Int32 pageSize, Int32 pageNumber, DataSourceSelectArguments arguments) +342 SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +104 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82 System.Web.UI.WebControls.ListControl.PerformSelect() +18 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.Control.PreRenderRecursiveInternal() +88 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5727


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

The only other interesting code in my pages is this

    LLBLGenProDataSource1.FilterToUse =
            new PredicateExpression(
            (MortgageFields.Status == status)
    );

Sorry this is a bit vague, but I would not know where to start in finding the cause of this,

Regards,

Matthew

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Jul-2006 15:44:40   

Does the MortgageEntity exists in any type of entity inheritance/hierarchy?

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 13-Jul-2006 16:16:17   

Hello,

No, it's just a plain old entity mapped to a single table.

Thanks,

Matthew

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 13-Jul-2006 17:00:08   

Are you using a different schema at runtime? It can't find the field: "fedge.dbo.t_Mortgage.status", which might have been there when you created the project but which isn't present anymore in the t_Mortgage table.

Frans Bouma | Lead developer LLBLGen Pro
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 13-Jul-2006 18:21:35   

Hello,

This area only happens when I add the filter statement shown at the bottom of the above post.

I have a grid view which displays correctly without any filtering turned on, and the State's column is clearly visible and correct.

Thanks for your quick response,

Regards,

Matthew

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 14-Jul-2006 05:32:02   

When you say the State's column is clearly visible do you mean the status? If not can you add the Status to the grid and see if it is able to be displayed.

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 14-Jul-2006 12:15:28   

Sorry,

I use speech recognition due to repetitive strain injury, hence the spelling mistake.

Yes, I did mean status and it works fine without the filter.

This is also one of the reasons why excellent design time support will really help me in application development :-)

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 14-Jul-2006 12:25:35   

I have also tried another field from the entity, with a different data type, I get the same error.

This table has lots and lots of fields, would this cause any problems?

I know it's difficult to try and come up with an answer without actually debugging the scenario, it's just very frustrating when these kind of error happened with code generation software as the lack of control as a user sometimes offsets the benefits of using the software. Initial impressions are that this will be fantastic, but obviously getting stuck like this is a real disheartening.

Regards,

Matthew

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 14-Jul-2006 12:43:25   

The reason for this error is that your generated code is out of sync with the schema of the database. If you program the whole DAL yourself or use a code generated one, the results will be the same: a field is referenced in the query which isn't there in the database schema.

The field: status, is that or isn't that part of the t_Mortgage table?

the thing is, you refer to that field in the filter you wrote. If the field has been renamed, or removed, please refresh the catalog in the llblgen pro designer, and re-generate your code.

Frans Bouma | Lead developer LLBLGen Pro
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 14-Jul-2006 16:16:31   

Hello Otis,

Since generating my project, I have not touched the database, the field is clearly in the database and there is no reason why the two should be out of synchronisation?

How can the status field work perfectly well in a data bound grid without a filter applied, as do all the other fields.

I have even tried regenerating my project and recompiling to no avail.

Is there anything I can do with the debugger that would help diagnose this?

Regards,

Matthew

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 14-Jul-2006 16:54:34   

Ok, we can rule that out.

Could you please enable DQE tracing for me? See troubleshooting and debugging in the manual, and run the application in debug mode, so you'll get the query generated into the output window of vs.net.

This way we can learn what the query is that has been generated but caused a problem when executed on the database.

Frans Bouma | Lead developer LLBLGen Pro
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 15-Jul-2006 23:22:09   

Thanks for pointing the debugging section out, I can safely say the problem was completely my fault as I was inadvertently using the wrong data source object (as I have more than one of them on the page), Doh!!, therefore I was creating a filter using an entity field from the mortgage entity, although the data source used a completely different entity collection?!

Sorry about that, Thank you for your help :-)