hi,
i have this stored procedure:
CREATE PROCEDURE dbo.usp_NearbyEntities
@Longitude float,
@Latitude float,
@Distance float
AS
BEGIN
SELECT E.IdEntita as IdEntita
FROM dbo.Lokalizacia L INNER JOIN
dbo.Entita E ON L.IdLokalizacia = E.IdLokalizacia
WHERE Acos( Sin( Pi()/180*@Latitude ) * Sin( Pi()/180*L.Latitude ) + Cos( Pi()/180*@Latitude ) * Cos( Pi()/180*L.Latitude ) * Cos( Pi()/180*L.Longitude - Pi()/180*@Longitude ) ) * 6378.1 <= @Distance
END
GO
which when called as a retrieval stored procedure returns a DataTable consisting of a single column IdEntita containing those ids which match the "nearby entity" criterion
then i have a few other criteria, but for that i use PredicateExpression to assemble the filter
now i would like to combine these two filters. at the present i do it very clumsily:
foreach (DataRow myRow in tableToFill.Rows)
{
decimal id = (decimal)myRow["IdEntita"];
predicate.AddWithOr( PredicateFactory.CompareValue( EntitaFieldIndex.IdEntita, ComparisonOperator.Equal, id ) );
}
this "predicate" is then added to the predicate expression with the other criteria.
i wonder if there is a way to do the same in one go instead of going through the loop
i'm using LLBLGen Pro v. 1.0.2005.1
Visual Studio 2003
self-servicing
SQL Server 2000
thanks for any suggestions,
kincho