Hi,
this is my code:
InfoRegGroupsTypedList InfoRegGroupsList1 = new InfoRegGroupsTypedList();
IPredicateExpression filter = new PredicateExpression();
filter.Add(PredicateFactory.CompareValue(InforegGroupsFieldIndex.Company, ComparisonOperator.Equal, CurrentUser.Company));
filter.Add(PredicateFactory.CompareValue(InforegGroupsFieldIndex.Registry, ComparisonOperator.Equal, "17"));
ISortExpression sorter = new SortExpression();
sorter.Add(SortClauseFactory.Create(InforegGroupsFieldIndex.Code, SortOperator.Ascending));
InfoRegGroupsList1.Fill(0, sorter, true, filter);
In the documentation I read that AllowDuplicates should be set to true, so I did that...
In SQL Profiler I get this query:
[code]
exec sp_executesql N'SELECT [InfoRegistryGroups].[CODE] AS [Code],[InfoRegistryGroups].[DESCRIPTION] AS [Description] FROM [dbo].[INFOREG_GROUPS] AS [InfoRegistryGroups] WHERE ( [dbo].[INFOREG_GROUPS].[COMPANY] = @Company1 And [dbo].[INFOREG_GROUPS].[REGISTRY] = @Registry2) ORDER BY [dbo].[INFOREG_GROUPS].
ASC', N'@Company1 varchar(3),@Registry2 varchar(2)', @Company1 = '001', @Registry2 = '17'
This goes wrong because the table is reference as InfoRegistryGroups while it is still using INFOREG_GROUPS as the table for the clause and the sort.
InfoRegistryGroups is the alias that I have given the TypedList in the designer.
Can anybody tell me what I am doing wrong?
Gr.,
G.I.