Hi,
We are using LLBLGenPro2.0 version in our web application.
In our application we have a method called "getPrimaryMembersRatio" to do some calculations.
Parameters are
1.entityid string[]
2.years string[]
It returns as "LLBLGen TypedView" object.
The method "getPrimaryMembersRatio" is working fine until entityid string[] elements <=2100.
When we pass the collection for entityid which are having more than 2100 values[elements],then
we got the error "Maximum parameters 2100".
Our approaches were
First:
PredicateFactory.CompareValue(EntityAverageRatiosViewFieldIndex.EntityId , ComparisonOperator.Equal, entityId)
Second:
Then we got the suggestion from LLBLGen forum we updated like
objFilterExp.Add(new FieldCompareSetPredicate(EntityAverageRatiosViewFields.EntityId, entityId, SetOperator.In, objPGFilterExp));
It was not working since the entityId is not entityfield. Also we don't want to go for creating temp tables to store the array collections.
Third:
Currently we are using for loop to achieve this like below:
public EntityAverageRatiosViewTypedView getPrimaryMembersRatio(string[] entityId, string[] years)
{
EntityAverageRatiosViewTypedView objPrimaryRatio = null;
try
{
//Resetting the CommandTimeOut
DbUtils.CommandTimeOut = CDMS.COMMON.StaticMembers.CommandTimeout;
objPrimaryRatio = new EntityAverageRatiosViewTypedView();
foreach (string entity_id in entityId)
{
IPredicateExpression objFilterExp = new PredicateExpression();
objFilterExp.Add(EntityAverageRatiosViewFields.EntityId == entity_id);
objFilterExp.AddWithAnd(EntityAverageRatiosViewFields.FlagPgmember == 1);
objFilterExp.AddWithAnd(EntityAverageRatiosViewFields.ReportingYear == years);
EntityAverageRatiosViewTypedView tempview = new EntityAverageRatiosViewTypedView();
tempview.Fill(0, null, true, objFilterExp);
objPrimaryRatio.Rows.Add(tempview.Rows[0].ItemArray);
}
return objPrimaryRatio;
}
catch (Exception ex)
{
CDMS.COMMON.ExceptionLog.Log.Error(ex.Message, ex);
throw ex;
}
}
The third approach is getting too slow.
Can anyone suggest how can we achieve this with better performance?
Thanks in advance,
Balaji