Click here to Skip to main content
16,017,015 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
the code is given below
C#
Userdir = (from u in Userdir where u.FirstName.ToUpper().Contains(searchString.ToUpper().Trim()) || u.LastName.ToUpper().Contains(searchString.ToUpper().Trim()) || u.Username.ToUpper().Contains(searchString.ToUpper().Trim()) || u.Email.ToUpper().Contains(searchString.ToUpper().Trim()) || (u.Phone.Length < 0  ? 0 : u.Phone.Contains(searchString)) select u).ToList(); 



in the above query the conditional operator error shows

implicit conversion between int and bool








pls help me
Posted

1 solution

C#
(u.Phone.Length < 0  ? 0 : u.Phone.Contains(searchString)) select u).ToList(); 

Try
C#
(u.Phone.Length < 0  ? false : u.Phone.Contains(searchString)) select u).ToList(); 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900