C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet679/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   675   676   677   678   679   680   681   682   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

N

OTE

N

OTE

LINQ in C# is essentially a language within a language. As a result, the subject of LINQ is 

quite large, involving many features, options, and alternatives. Although this chapter describes 

LINQ in significant detail, it is not possible to explore all facets, nuances, and applications of this 

powerful feature. To do so would require an entire book of its own. Instead, this chapter focuses 

on the core elements of LINQ and presents numerous examples. It is important to understand 

that we are just now at the beginning of the LINQ revolution. Going forward, LINQ is a 

subsystem that you will want to study in greater detail.

What Is LINQ?

LINQ stands for 



Language-Integrated Query.

 It encompasses a set of features that let you 

retrieve information from a data source. As you may know, the retrieval of data constitutes an 

important part of many programs. For example, a program might obtain information from a 

customer list, look up product information in a catalog, or access an employee’s record. In 

many cases, such data is stored in a database that is separate from the application. For 

example, a product catalog might be stored in a relational database. In the past, interacting 

with such a database would involve generating queries using Structured Query Language 

(SQL). Other sources of data, such as XML, required their own approach. Therefore, prior to 

C# 3.0, support for such queries was not built into C#. LINQ changes this.

LINQ adds to C# the ability to generate queries for any LINQ-compatible data source. 

Furthermore, the syntax used for the query is the same, no matter what data source is used. 

This means that the syntax used to query data in a relational database is the same as that 

545


CHAPTER

www.freepdf-books.com




546

 

P a r t   I :  



T h e   C #   L a n g u a g e

used to query data stored in an array, for example. It is no longer necessary to use SQL or 

any other non-C# mechanism. The query capability is fully integrated into the C# language.

In addition to using LINQ with SQL, LINQ can be used with XML files and ADO.NET 

Datasets. Perhaps equally important, it can also be used with C# arrays and collections 

(described in Chapter 24). Therefore, LINQ gives you a uniform way to access data. This is a 

powerful, innovative concept. It is not only changing the way that data is accessed, but it also 

offers a new way to think about and approach old problems. In the future, many programming 

solutions will be crafted in terms of LINQ. Its effects will not be limited to just database access.

LINQ is supported by a set of interrelated features, including the query syntax added to 

the C# language, lambda expressions, anonymous types, and extension methods. Lambda 

expressions are described in Chapter 15. The others are examined here.




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   675   676   677   678   679   680   681   682   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish