Language Integrated Query (LINQ) Question:
Download Questions PDF

Why do we use “Contains” method for strings type functions?

Answer:

Contains method Used to find all matching records From Given string using Matching keywords.
Example-
This Examples returns the Customer Names from Customer tables whose Names have contains “Anders”

Public void LinqToSqlStringUsingContains()
{
Var q = From c In db.Customers _
Where c.ContactName.Contains("Anders") _
Select c
ObjectDumper.Write(q)
}

Download LINQ Interview Questions And Answers PDF

Previous QuestionNext Question
List out the Data Context Functions. Where do we use “SubmitChanges()”?What is Quantifiers in reference linq to Dataset?