Language Integrated Query: An introduction
Language Integrated Query: An introduction
DamienGuard(BSc,MBCS) damien@envytech.co.uk
GuernseySoftwareDeveloperForum
What is LINQ?
? LanguageIntegratedQuery ? Makequeryapartofthelanguage ? Framework3.5 ? NowshippingwithVisualStudio2008
Query without LINQ
? ObjectsusingloopsandcondiVons foreach(Customer c in customers) if (c.Region == "UK") ...
? DatabasesusingSQL SELECT * FROM Customers WHERE Region='UK'
? XMLusingXPath/XQuery //Customers/Customer[@Region='UK']
ADO without LINQ
SqlConnection con = new SqlConnection(...); con.Open(); SqlCommand cmd = new SqlCommand(
@"SELECT * FROM Customers WHERE c.Region = @Region", con
); cmd.Parameters.AddWithValue("@Region", "UK"); DataReader dr = cmd.ExecuteReader(); while (dr.Read()) {
string name = dr.GetString(dr.GetOrdinal("Name")); string phone = dr.GetString(dr.GetOrdinal("Phone")); DateTime date = dr.GetDateTime(3); } dr.Close(); con.Close();
Query with LINQ
C#
var myCustomers = from c in customers where c.Region == "UK" select c;
Dim myCustomers = From c In customers _ Where c.Region = "UK" _ Select c
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- example of an introduction paragraph
- an introduction to marketing pdf
- how to write an introduction letter
- how to write an introduction about yourself
- model theory an introduction pdf
- structure of an introduction paragraph
- writing an introduction for an argument essay
- what does an introduction paragraph include
- marketing an introduction pdf free
- marketing an introduction 13e pdf
- how to write an introduction paragraph essay
- how to start an introduction paragraph essay