Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the List object that have to be 1500 record and i want to filter the data with contain me thod with Linq Quary but after the execution of Linqu its return 0 count value.

My code is
C#
List listVesselCodeMaster   = new List();
listVesselCodeMaster = new ClsCallVoyageCode().GetVesselName(); //this return the value

var result = from vessel in listVesselCodeMaster where vessel.VesselName.Contains(strFilter) select vessel;

The result variable count is 0.
Any body help me why contain function not work on list object.

Regards,
Ravi Sharma
Posted
v2

1 solution

The above Issue Resolve..put Upper Case letter both string..code is below

return (from vessel in listVesselCodeMaster where vessel.VesselName.ToUpper().Contains(strFilter.ToUpper()) select vessel).ToList();

Regards,
Ravi Sharma
 
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