LLBLGen Pro Version: 2.6 Final (April 15th, 2009)
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll - 2.6.9.511
.NET 3.5
MSSQL 2005
Adapter Template
I am getting duplicate rows returned from my FetchEntityCollection call. Here is my code:
IncludeFieldsList IFL = new IncludeFieldsList();
IFL.Add(VOracleClusterDetailFields.RacEnvId);
IFL.Add(VOracleClusterDetailFields.MachineId);
IFL.Add(VOracleClusterDetailFields.ProductNm);
IFL.Add(VOracleClusterDetailFields.AppId);
RelationPredicateBucket Filter = new RelationPredicateBucket();
Filter.PredicateExpression.Add(VOracleClusterDetailFields.RacEnvId % FilterExpression);
if (Sorter == null)
{
ISortExpression sorter = new SortExpression();
sorter.Add(VOracleClusterDetailFields.RacEnvId | SortOperator.Ascending);
sorter.Add(VOracleClusterDetailFields.MachineId | SortOperator.Ascending);
sorter.Add(VOracleClusterDetailFields.ProductNm | SortOperator.Ascending);
Sorter = sorter;
}
_GV.DataSource = ddh.GetOracleClusterNodes(Filter, Sorter, true, IFL);
The call to ddh.GetOracleClusterNodes is:
public EntityCollection<VOracleClusterDetailEntity> GetOracleClusterNodes(IRelationPredicateBucket irpb, ISortExpression ise, bool bExactMatch, ExcludeIncludeFieldsList EIFL)
{
EntityCollection<VOracleClusterDetailEntity> _collection = new EntityCollection<VOracleClusterDetailEntity>(new VOracleClusterDetailEntityFactory());
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntityCollection(_collection, irpb, 0, ise, null, EIFL);
if (_collection.Count == 0 && !bExactMatch)
{
adapter.FetchEntityCollection(_collection, null);
}
return _collection;
}
All fields included in the IncludeFieldList are char fields, so I have no fields in the select list that would negate a DISTINCT keyword. Here is the select statement it produces:
exec sp_executesql N'SELECT [dbinfo].[dbo].[v_oracle_cluster_detail].[rac_env_id] AS [RacEnvId], [dbinfo].[dbo].[v_oracle_cluster_detail].[machine_id] AS [MachineId], [dbinfo].[dbo].[v_oracle_cluster_detail].[product_nm] AS [ProductNm], [dbinfo].[dbo].[v_oracle_cluster_detail].[app_id] AS [AppId] FROM [dbinfo].[dbo].[v_oracle_cluster_detail] WHERE ( ( [dbinfo].[dbo].[v_oracle_cluster_detail].[rac_env_id] LIKE @RacEnvId1)) ORDER BY [dbinfo].[dbo].[v_oracle_cluster_detail].[rac_env_id] ASC,[dbinfo].[dbo].[v_oracle_cluster_detail].[machine_id] ASC,[dbinfo].[dbo].[v_oracle_cluster_detail].[product_nm] ASC',N'@RacEnvId1 nvarchar(2)',@RacEnvId1=N'41'
What do I need to do to get only distinct rows in my resultset?
Thanks....