I can use linq to sql to match a part of a string with
From C In DB.City Where C.Name.Contains(Query)
What i need to do for it to match only beginning of words? (Behave like full text index)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can check if the first word starts with the query by using
StartsWithinstead ofContains:This only checks the first word, not all words in the string.
You can’t do a full text search directly using LINQ. What you can do instead is create a stored procedure to do the full text search and call that using LINQ.
Related question:
See also: