Where clause doesnt work

Posts   
 
    
UserWtd
User
Posts: 4
Joined: 30-Jan-2013
# Posted on: 01-Apr-2013 17:40:57   

Hi friends,

I have this linq where clause ;

where (up.IsSendBsh == false || up.IsSendBsh == null) && i.IsDeleted == false && (ordActivity.Status == 1 || ordActivity.Status == 7 || ordActivity.Status == 11) && ord.CarrierCode.Value.Equals(null) && ord.DepartueCode != null && ord.DestinationCode != null && up.Status != 5 && i.DeliveryNoteNo != null && i.DeliveryNoteDate != null

And i convert to sql like this ;

where (od.IsSendBsh = 0 or od.IsSendBsh = null) and i.IsDeleted = 0 and (oa.Status =1 or oa.Status =7 or oa.Status = 11) and ord.CarrierCode IS NOT NULL and ord.DepartueCode IS NOT NULL AND ord.DestinationCode IS NOT NULL AND od.Status !=5 and i.DeliveryNoteNo IS NOT NULL and i.DeliveryNoteDate IS NOT NULL

Is there any problem ? Is not "!=null" and "IS NOT NULL" same things ?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 01-Apr-2013 19:21:42   

(!= null) is translated into: IS NOT NULL

What's the problem?

UserWtd
User
Posts: 4
Joined: 30-Jan-2013
# Posted on: 01-Apr-2013 19:25:23   

Linq query was not return response. But we fixed it. Thanks. simple_smile