What is LINQ and INTRODUCTION of LINQ
· Full Form Of LINQ Language Integrated Query
· Query expressions can be used to query and to transform data from any LINQ-enabled data source. For example, a single query can retrieve data from a SQL database, and produce an XML stream as output.
· A query is not executed until you iterate over the query variable, for example, in a foreach
statement.
· XML documents: LINQ to XML
· ADO.NET Entity Framework: LINQ to entities
Example
int[] numbers = { 20, 32, 45, 60, 90, 10, 5 };
var result = from s in numbers
where s > 20
select s;
foreach (var item in result)
{
Response.Write(item + "</br>");
}
return View();
Comments
Post a Comment