Am trying to search the student details with their name or email or mobile. For this I've three textboxes for Name, Email and Mobile.
And in my code I tried to get these details like,
DataObject entities=new DataObject();
foreach (DataObject.Student student in entities.students.Where(p =>
(p.FIRSTNAME+p.LASTNAME).Contains(txtName.Text)
|| p.MOBILE.Contains(txtMobile.Text)
|| p.EMAIL.Contains(txtEmail.Text))
{
//
}
and here, if I type sham in the Email or in the Name textbox, its listing all the student details available in the database instead of listing only the student name or email contains sham.
When I was debugging this, I tried giving the same valuesham,sham,sham for name,mobile and email its listing perfectly, and also if I want to search by name that contains sham, and If I type sham in name, and anything else in the email and mobile, this also working perfectly....
One thing I came to know from this is, it expects all the parameter should have some value, I dunno why this expects like this, and I dunno how to fix this, can anyone help me here. Thanks in advance