Problem FetchTypedList

Posts   
 
    
luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 04-Sep-2007 23:16:47   

Hi! I have the next code

                DataTable tabla = new DataTable();
                DataSet SetRegsCon = new DataSet();
                ResultsetFields campos = new ResultsetFields(4);
                campos.DefineField(view.UsuCodigo, 0, "UsuCodigo");
                campos.DefineField(view.UsuNombre, 1, "UsuNombre");
                campos.DefineField(view.Asignado, 2, "Asignado", String.Empty, AggregateFunction.Max);
                campos.DefineField(view.TarCodigo, 3, "TarCodigo", String.Empty, AggregateFunction.Max);
                IGroupByCollection coleGroup = new GroupByCollection();
                coleGroup.Add(campos["UsuCodigo"]);
                coleGroup.Add(campos["UsuNombre"]);
                IRelationPredicateBucket relaciones = new RelationPredicateBucket();
                relaciones.PredicateExpression.Add(this.Filter(pObjCriteria).PredicateExpression);
                ISortExpression ordenador = new SortExpression();
                this.objAdapter.FetchTypedList(campos, tabla, relaciones, 0, ordenador, false, coleGroup);
                return tabla;

When I do the this.objAdapter.FetchTypedList() instruction, tabla has this header columns: "UsuCodigo", "UsuNombre", "Column1", "TarCodigo", I don't understand why the column header of the field Asignado changes. The fields are: Varchar, Varchar, Int32, Int32.

Somebody please can help me?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Sep-2007 09:06:26   

tabla has this header columns: "UsuCodigo", "UsuNombre", "Column1", "TarCodigo", I don't understand why the column header of the field Asignado changes

Do you mean these are the headers of the columns of the Grid used to display the results? Grid columnm headers can be set by the developer and they might be different than the aliases used for the fields in the resultset.

luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 05-Sep-2007 16:36:32   

Walaa wrote:

tabla has this header columns: "UsuCodigo", "UsuNombre", "Column1", "TarCodigo", I don't understand why the column header of the field Asignado changes

Do you mean these are the headers of the columns of the Grid used to display the results? Grid columnm headers can be set by the developer and they might be different than the aliases used for the fields in the resultset.

No, the headers aren't used to display the data! The headers are used to establish the "ColumnSource" on a WebGrid Infragistics, so, when I do Databind(), the data for this column isn't display.

I know that I can change the DataColumn source, so, I can define "Column1", but I think that is wrong because the field defined was "Asignado".

Any idea?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Sep-2007 16:53:42   

How do you specify the dataSource for the DataGrid? Would you please post the Grid ASP code?

luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 05-Sep-2007 17:09:50   

Here's the Aspx Code to define the ColumnSource ( "BaseColumnName")

<Columns>
    <igtbl:UltraGridColumn AllowUpdate="Yes" BaseColumnName="Asignado" Key="Asignado"
        Type="CheckBox" Width="25px">
        <Header Caption="Asig.">
        </Header>
    </igtbl:UltraGridColumn>
    <igtbl:UltraGridColumn BaseColumnName="UsuCodigo" Hidden="True" Key="UsuCodigo">
        <Header Caption="Codigo">
            <RowLayoutColumnInfo OriginX="1" />
        </Header>
        <Footer>
            <RowLayoutColumnInfo OriginX="1" />
        </Footer>
    </igtbl:UltraGridColumn>
    <igtbl:UltraGridColumn BaseColumnName="UsuNombre" Key="UsuNombre" Width="225px">
        <Header Caption="Nombre">
            <RowLayoutColumnInfo OriginX="2" />
        </Header>
        <Footer>
            <RowLayoutColumnInfo OriginX="2" />
        </Footer>
    </igtbl:UltraGridColumn>

    <igtbl:UltraGridColumn BaseColumnName="TarCodigo" Key="TarCodigo" Width="225px">
        <Header Caption="TaskCodigo">
            <RowLayoutColumnInfo OriginX="3" />
        </Header>
        <Footer>
            <RowLayoutColumnInfo OriginX="3" />
        </Footer>
    </igtbl:UltraGridColumn>
</Columns>
luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 05-Sep-2007 17:36:46   

I attach one file that shows the schema's LLBL of the view.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Sep-2007 05:55:20   

Could you please post the generated SQL code for the fetch? (LLBLGenPro Help - Using generated code - Troubleshooting and Debugging)

David Elizondo | LLBLGen Support Team
luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 06-Sep-2007 07:34:23   

daelmo wrote:

Could you please post the generated SQL code for the fetch? (LLBLGenPro Help - Using generated code - Troubleshooting and Debugging)

Here is. I take it from a SQL Profiler. It's OK or is better that I take it from the Debugging ?

exec sp_executesql 
N'SELECT DISTINCT 
     [dbo].[vw_UsuarioXTarea].[USU_CODIGO] AS [UsuCodigo],
     [dbo].[vw_UsuarioXTarea].[USU_NOMBRE] AS [UsuNombre],
     MAX([dbo].[vw_UsuarioXTarea].[Asignado]), 
     MAX([dbo].[vw_UsuarioXTarea].[TAR_Codigo]) AS [TarCodigo] 
FROM [dbo].[vw_UsuarioXTarea] 
WHERE ( 
               (
                    (
                         [dbo].[vw_UsuarioXTarea].[TAR_Codigo] = @TarCodigo1 OR
                         [dbo].[vw_UsuarioXTarea].[TAR_Codigo] = @TarCodigo2
                    )
               )
          )
GROUP BY [dbo].[vw_UsuarioXTarea].[USU_CODIGO],[dbo].[vw_UsuarioXTarea].[USU_NOMBRE]', N'@TarCodigo1 int,@TarCodigo2 int', @TarCodigo1 = 9, @TarCodigo2 = -1
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Sep-2007 11:39:06   

Which LLBLGen Pro runtime library version are you using?

luriaseo
User
Posts: 8
Joined: 04-Sep-2007
# Posted on: 06-Sep-2007 16:41:16   

I was using the 2005.1 Final October, but I just upgrade to 2005.1 Final July 6th, and it works! simple_smile

Thanks !