Dear i want to search the user from database table when user was entered the value into search textbox by using LINQ in ADO.net
i have one search textbox ..when user enter any letter than search Username from table who's name contain this letter !
i have Code for this:-
[HttpPost]
public ActionResult Userlist(string UserName)
{
var U_master = db.User_Masters.ToList();
if (!string.IsNullOrEmpty(UserName))
U_master = U_master.Where(a => a.Username.Contains(UserName)).ToList();
return PartialView("Userlist", U_master);
}
By using this code i can search Username only Text box value will match with username of database table but i want to display all the username record from database when user was the entered only single letter of Username ..and display all the Username who's name contain this letter . please give format to write LIKE Query or give any example..!