Linq-to-SQL statement issue

Posted by Anicho on Stack Overflow See other posts from Stack Overflow or by Anicho
Published on 2010-04-18T21:26:10Z Indexed on 2010/04/18 21:33 UTC
Read the original article Hit count: 622

Filed under:
|
|

I am basically looking to bind a search query to a gridview which is nice, but this must be done by a users input query (sort of like a search function). I can get single values and rows returned, but how would I get it to search all columns in my database for the inputted values and return it?

My code so far is:

Void SearchFunction()
{
  TiamoDataContext context = new TiamoDataContext();

  var search = from p in context.UserProfiles
      where = p.DanceType == UserSearchString
      select p;

  UserSearchGrid.DataSource = search;
  UserSearchGrid.DataBind();
}

I tried p.equals but am pretty sure thats not the way to go about it.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#