SQL Query in LINQ
Good to hear.You can simplify your conditions and you will get the following. (which is exactly what I suggested before) (isPaid == null || t.IsPaid == isPaid) If you have any questions let me know....
View ArticleSQL Query in LINQ
Oh sorry, completely forgot to update the thread. It worked actually and it was all my mistake or I overlooked the concept myself.Like mentioned in native SQL a condition should be " ((@IsPaid IS NOT...
View ArticleSQL Query in LINQ
Any update? Would you mind letting us know how's it going now?Best Regards,Larcolais Gong[MSFT] MSDN Community Support | Feedback to usGet or Request Code Sample from Microsoft Please remember to mark...
View ArticleSQL Query in LINQ
Hi Syed,I meant about your local variable (isPaid)If IsPaid is "not NULL" then the t.IsPaid == null cannot be true...Could you please try this one below?return dc.TicketInfos.Where(t => ((locationId...
View ArticleSQL Query in LINQ
Hi Peter!Thanks for replying. Yes IsPaid is bool and "not NULL" in generated dbml file and in Database as well. But why it executes perfectly on SQL server end and not by code? By the way I don't get...
View ArticleSQL Query in LINQ
Hi Syed, Is isPaid a bool in your code?If yes then it cannot be null, unless you defined it as "bool?".If it is a bool and not a bool? then you probably got a warning message at build like this:"The...
View ArticleSQL Query in LINQ
HiI am trying to build a SQL query that works 100% in SQL server in stored procedure for fetching records on dynamic criteria like it will filter the record if parameter value is given, if left Null it...
View Article