problems with NULL value

Posts   
 
    
Posts: 18
Joined: 26-Jun-2006
# Posted on: 18-Aug-2006 03:48:57   

Hi,

the code below does not work , problem with
Filter.AddWithAnd( EmployeeBenefitsFields.TerminationDate != System.DBNull.Value);

I trying to get all rows that termination date field value is not null. Please could you help me to deal with it, I do not what to do.

code is listed below

thanks,

Carlos,

public static EmployeeBenefitsCollection GetEmpBenefitCollection(
            string strPolicy, int strDivision, int strClass, int strEmployee)
    {
        IPredicateExpression Filter = new PredicateExpression();
        Filter.Add(
            EmployeeBenefitsFields.PolicyId == strPolicy);
        Filter.AddWithAnd(
            EmployeeBenefitsFields.DivisionId == strDivision);
        Filter.AddWithAnd(
            EmployeeBenefitsFields.ClassId == strClass);
        Filter.AddWithAnd(
            EmployeeBenefitsFields.EmployeeId == strEmployee);
        Filter.AddWithAnd(
            EmployeeBenefitsFields.TerminationDate != System.DBNull.Value);

        ISortExpression Sort = new SortExpression();
        Sort.Add(
            EmployeeBenefitsFields.BenefitId | SortOperator.Ascending);
        EmployeeBenefitsCollection ParmItem = new EmployeeBenefitsCollection();
        ParmItem.GetMulti(Filter, 0, Sort);
        return ParmItem;
    }
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Aug-2006 07:31:09   

the code below does not work

How is that? do you get an exception? if so please post the exception text and the complete stack trace.

If you mean that the query doesn't perform as you expect then please examine the generated query and run it against the database to see what's going wrong. refer to LLBLGen docs "Using the generated code -> Troubleshooting and debugging"