Hello all,
I work on SQL Server and use LLBL v2.0 adapter, .NET 2.0.50727.
I need to construct a sql statement like that to obtain invoices
AND ([T_FACTURES].[FAC_S_ID] LIKE '%/ AA'
OR [T_FACTURES].[FAC_S_ID] LIKE '%/ DA'
OR [T_FACTURES].[FAC_S_ID] LIKE '%/ AV')
This is my code
foreach (DataRow dr in sousRequete.Rows)
{
param = "%/ " + dr.ItemArray[0];
if (first)
{
bucket.PredicateExpression.Add(TFacturesFields.FacSId % param);
first = false;
}
else
{
bucket.PredicateExpression.AddWithOr(TFacturesFields.FacSId % param);
}
}
But the generated sql is
AND [T_FACTURES].[FAC_S_ID] LIKE '%/ AA'
OR [T_FACTURES].[FAC_S_ID] LIKE '%/ DA'
OR [T_FACTURES].[FAC_S_ID] LIKE '%/ AV'
() missing in my sql statement and my result is not correct.
Could you help me