Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
(from ci in list
where ci.Subject.Contains(emailSubject)

select ci).ToList<unreademails>();
</unreademails>


i wort above code for search in data grid but i need to search from case Insensitive pls tell me how can i do it
Posted
Updated 11-Jun-10 0:20am
v2

See if you can use ci.subject..IndexOf(temp,StringComparison.CurrentCultureIgnoreCase) >= 0;.
 
Share this answer
 
I don't know if this will work, as I haven't tried it myself, but you could try something like
C#
(from ci in list
where ci.Subject.ToUpper().Contains(emailSubject.ToUpper())
select ci).ToList();
 
Share this answer
 
Comments
Kasunmit 11-Jun-10 6:35am    
thanx i followed this and get successfully completed ..
.NET list doesn't support explicitly setting comparer used.This means that you should work around this.You have several ways to solve the problem:
1.work in uppercase/lowercase only.
2.scan manually the list and use String.Compare instead of IList.Contains.
3.Implement proper comparer of your collection elements.You could do it by implementing IComparer or IComparable.
 
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