Answers

Question and Answer:

  Home  LINQ

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

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)

}

 190 views

More Questions for you: