Bug? TypedList multi-part identifier could not be bound

Posts   
 
    
juangelos
User
Posts: 15
Joined: 30-Mar-2009
# Posted on: 05-Apr-2009 03:51:41   

LLBLGen Pro. Version: 2.6 Final ( October 6th, 2008 )

An exception was caught during the execution of a retrieval query: The multi-part identifier "pulsar.Facturación.FacturaCorp.Id" could not be bound.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.


   var facId = (int) this.facturaIId.Value;
   this.facturaIDisplayTypedList1.Fill(1, null, false, FacturaCorpFields.Id == facId);

Relevant exception properties:

InnerException (tostring): "The multi-part identifier \"pulsar.Facturación.FacturaCorp.Id\" could not be bound." RuntimeBuild: "03132009" RuntimeVersion: "2.6.0.0"


   at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
   at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowDataTableRetrievalQuery(IRetrievalQuery queryToExecute, DbDataAdapter dataAdapterToUse, DataTable tableToFill, IEntityFields fieldsToReturn)
   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 Pulsar2.Facturación.Data.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 E:\PULSAR\src\PULSAR1\Solution2\Dal\DaoClasses\TypedListDAO.cs:line 49
   at Pulsar2.Facturación.Data.TypedListClasses.FacturaCorpDisplayTypedList.Fill(Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IPredicate selectFilter, ITransaction transactionToUse, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) in E:\PULSAR\src\PULSAR1\Solution2\Dal\TypedListClasses\FacturaCorpDisplayTypedList.cs:line 220
   at Pulsar2.Facturación.Data.TypedListClasses.FacturaCorpDisplayTypedList.Fill(Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IPredicate selectFilter) in E:\PULSAR\src\PULSAR1\Solution2\Dal\TypedListClasses\FacturaCorpDisplayTypedList.cs:line 168
   at Fact.FacturasCorp.ImpresiónFacturaCorp.ImpresiónFacturaCorp_ParametersRequestSubmit(Object sender, ParametersRequestEventArgs e) in E:\PULSAR\src\PULSAR1\Solution2\Apps\Fact\FacturasCorp\ImpresiónFacturaCorp.cs:line 20
   at DevExpress.XtraReports.UI.XtraReport.OnParametersRequestSubmit(ParametersRequestEventArgs e)
   at DevExpress.XtraReports.Native.Parameters.ParametersControl.Submit()
   at DevExpress.XtraReports.Native.Parameters.ParametersControl.submitButton_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs 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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at MiniFramework.App.AppController.Launch(IMainForm mainForm) in E:\PULSAR\src\PULSAR1\Solution2\MiniFramework\App\AppController.cs:line 60
   at Fact.Program.Main() in E:\PULSAR\src\PULSAR1\Solution2\Apps\Fact\Program.cs:line 16
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

QueryExecuted:

SELECT DISTINCT TOP 1 
    [LPA_F3].[Id], 
    [LPA_F3].[Titular], 
    [LPA_F3].[Serie], 
    [LPA_F3].[Número], 
    [LPA_F3].[Comprador], 
    [LPA_F3].[Fecha], 
    [LPA_T1].[RazónSocial] AS [TitRazónSocial], 
    [LPA_T1].[NombreFantasía] AS [TitNombreFantasía], 
    [LPA_T1].[Dirección] AS [TitDirección], 
    [LPA_T6].[Nombre] AS [TitCiudad], 
    [LPA_T6].[CódigoPostal] AS [TitCP], 
    [LPA_T8].[Nombre] AS [TitProvincia], 
    [LPA_T10].[Nombre] AS [TitPaís], 
    [LPA_T1].[Teléfono] AS [TitTeléfono], 
    [LPA_T1].[Cuit] AS [TitCuit], 
    [LPA_T1].[IngBrutos] AS [TitIngBrutos], 
    [LPA_C4].[RazónSocial] AS [CompRazónSocial], 
    [LPA_C4].[NombreFantasía] AS [CompNombreFantasía], 
    [LPA_C4].[Dirección] AS [CompDirección], 
    [LPA_C7].[Nombre] AS [CompCiudad], 
    [LPA_C7].[CódigoPostal] AS [CompCP], 
    [LPA_C9].[Nombre] AS [CompProvincia], 
    [LPA_C11].[Nombre] AS [CompPaís], 
    [LPA_C4].[Teléfono] AS [CompTeléfono], 
    [LPA_C4].[Cuit] AS [CompCuit], 
    [LPA_C4].[IngBrutos] AS [CompIngBrutos], 
    [LPA_F3].[Subtotal], 
    [LPA_F3].[IVA] AS [Iva], 
    [LPA_F3].[Total] 

FROM 
    (
        (
            (
                (
                    (
                        (
                            (
                                (
                                    (
                                        ( 
                                            [pulsar].[Global].[Titular] [LPA_T2]  INNER JOIN [pulsar].[Facturación].[FacturaCorp] [LPA_F3]  
                                            ON  [LPA_T2].[Id]=[LPA_F3].[Titular]
                                        ) 
                                        INNER JOIN [pulsar].[dbo].[Empresa] [LPA_T1]  
                                        ON  [LPA_T1].[Id]=[LPA_T2].[Id]
                                    ) 
                                    INNER JOIN [pulsar].[Global].[Titular] [LPA_C5]  
                                    ON  [LPA_C5].[Id]=[LPA_F3].[Comprador]
                                ) 
                                INNER JOIN [pulsar].[dbo].[Empresa] [LPA_C4]  
                                ON  [LPA_C4].[Id]=[LPA_C5].[Id]
                            ) 
                            INNER JOIN [pulsar].[dbo].[Ciudad] [LPA_T6]  
                            ON  [LPA_T6].[Ciudad]=[LPA_T1].[Ciudad]
                        ) 
                        INNER JOIN [pulsar].[dbo].[Ciudad] [LPA_C7]  
                        ON  [LPA_C7].[Ciudad]=[LPA_C4].[Ciudad]
                    ) 
                    INNER JOIN [pulsar].[dbo].[ProvinciaEstado] [LPA_T8]  
                    ON  [LPA_T8].[ProvinciaEstado]=[LPA_T6].[ProvinciaEstado]
                ) 
                INNER JOIN [pulsar].[dbo].[ProvinciaEstado] [LPA_C9]  
                ON  [LPA_C9].[ProvinciaEstado]=[LPA_C7].[ProvinciaEstado]
            ) 
            INNER JOIN [pulsar].[dbo].[País] [LPA_T10]  
            ON  [LPA_T10].[País]=[LPA_T8].[País]
        ) 
        INNER JOIN [pulsar].[dbo].[País] [LPA_C11]  
        ON  [LPA_C11].[País]=[LPA_C9].[País]
    ) 
WHERE 
    ( 
        [pulsar].[Facturación].[FacturaCorp].[Id] = @Id1 AND 
        (( [LPA_T2].[Id] IS NOT NULL))
    )

Parameter: @Id1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 5.

If I paste this query into the query designer in vs, it corrects the where clause to be:

WHERE (LPA_F3.Id = @Id1) AND (LPA_T2.Id IS NOT NULL)

and it runs ok, retrieving the expected data.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 05-Apr-2009 10:29:07   

You specify a field filter however you don't set the objectalias for the field, while you likely have specified an alias for the entity in the typedlist editor in the designer, correct? If so, (say it's 'A'), do: this.facturaIDisplayTypedList1.Fill(1, null, false, FacturaCorpFields.Id.SetObjectAlias("A") == facId);

Frans Bouma | Lead developer LLBLGen Pro
juangelos
User
Posts: 15
Joined: 30-Mar-2009
# Posted on: 06-Apr-2009 00:13:37   

Perfect, amazing.

Works.

thanks