LINQ Quickly

A Practical Guide to Programming Language Integrated Query with C#
Preview in Mapt

LINQ Quickly

N Satheesh Kumar

A Practical Guide to Programming Language Integrated Query with C#
Mapt Subscription
FREE
$29.99/m after trial
eBook
$14.70
RRP $20.99
Save 29%
Print + eBook
$34.99
RRP $34.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$14.70
$34.99
$29.99p/m after trial
RRP $20.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


LINQ Quickly Book Cover
LINQ Quickly
$ 20.99
$ 14.70
Working with Linux - Quick Hacks for the Command Line Book Cover
Working with Linux - Quick Hacks for the Command Line
$ 31.99
$ 22.40
Buy 2 for $32.20
Save $20.78
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781847192547
Paperback252 pages

Book Description

This book gets you started with LINQ and shows how it will make your programming life easier by making use of new features from the .NET Framework 3.0. This book is split into seven chapters, each of which is dedicated to presenting a feature of LINQ and its usage in real-life scenarios.

Language Integrated Query (LINQ) is a new feature in Visual Studio 2008 that extends its query capabilities, using C# and Visual Basic. Visual Studio 2008 comes with
LINQ provider assemblies that enable the use of LINQ with data sources such as in-memory collections, SQL relational databases, ADO.NET Datasets, XML documents, etc.
In Visual Studio 2008, Visual C# and Visual Basic are the languages that implement the LINQ language extensions. LINQ language extensions use the new standard query operators API, which is the query language for any collection that implements IEnumerable<T>.

Table of Contents

Chapter 1: Overview
LINQ Architecture
Integration with SQL
Integration with XML
Support for C# 3.0 Language Features
Summary
Chapter 2: LINQ to Objects
Array of Integers
Collection of Objects
Reading from Strings
Reading from Text Files
Summary
Chapter 3: LINQ to XML
Features
Class Library
LINQ to XML with Other XML Technologies
XML Names
Loading and Traversing XML
Data Manipulation
Outputting and Streaming XML
Querying XML
Writing XML as Text Files and CSV Files
Reading from CSV Files
LINQ to XML Events
XML Literals and Embedded Expressions in Visual Basic
Summary
Chapter 4: LINQ to SQL
Working with Databases Using DataContext
Entity Classes
Creating and Deleting Databases
DataContext Methods
Data Manipulation
LINQ to SQL Queries
Object Relational Designer (O/R Designer)
Summary
Chapter 5: LINQ over DataSet
Loading Data into DataSets
Querying Datasets
Sequence Operator
Querying Typed DataSets
DataSet Query Operators
Projection
Join
SequenceEqual
Skip
Distinct
Summary
Chapter 6: LINQ to XSD
Un-typed XML
Typed XML
Creating Typed XML using Visual Studio
Customization of XML Objects
Using LINQ to XSD at Command Line
Summary
Chapter 7: Standard Query Operators
Restriction Operators
Projection Operators
Join Operators
Concatenation Operator
Ordering Operators
Set Operators
Grouping Operators
Conversion Operators
Equality Operators
Generation Operators
Quantifiers
Aggregation Operators
Partitioning Operators
Element Operators
List of Query Operators
Summary

What You Will Learn

  • Overview of new features for LINQ in .NET 3.0—partial methods, expressions, anonymous types, initializers, and implicitly typed local variables
  • Accessing in-memory data structures using LINQ—lists, arrays, and dictionaries
  • Directly querying the collections and filtering the required values without using powerful filtering, ordering, and grouping capabilities
  • Creating and manipulating XML data through .NET using XElement and XAttribute
  • Creating and navigating XML trees using Functional Construction
  • Importing and exporting data from dictionaries, databases, objects, and CSV files
  • Creating and manipulating the database objects using the DataContext object
  • Working with stored procedures, user-defined functions, handling concurrency conflicts, and transactions during database updates
  • Working with .NET framework data providers and DataSets
  • Using DataSet for easier and faster querying of cached data
  • Working with typed and un-typed XML trees using XSD
  • Examining standard query operators provided by LINQ and using them to query data sources
  • Implementing your own standard query operators
  • Building an ASP.NET web application

Chapter 1 looks at the overall features of LINQ, and gives an overview of different operators provided by LINQ to operate on objects, XML, relational databases, etc.
 
Chapter 2 examines LINQ to Objects, which means that you can use LINQ to query objects in a collection. Using this feature, you can access in-memory data structures using LINQ. You can directly query collections, and filter out required values without using powerful filtering, ordering, and grouping capabilities.

Chapter 3 looks at LINQ to XML. It is a new in-memory XML programming API to work against XML data. There are different ways of creating XML trees in .NET. LINQ to XML is the new method of creating and manipulating XML data through .NET. The properties and methods of LINQ help in navigating and manipulating XML elements and attributes.

Chapter 4, which covers LINQ to SQL, takes care of translating LINQ expressions into equivalent T-SQL, passing it on to the database for execution, and then returning the results back to the calling application. It reduces programming time a lot, and comes with two different design-time tools, which are used for converting the relational database objects into object definitions. It also has the ability to create databases, and database objects.

Chapter 5 examines LINQ to DataSets. An ADO.NET DataSet provides a disconnected data source environment for applications. It can be used with multiple data sources. The DataSet has the flexibility of handling data locally in cache memory where the application resides. The application can continue working with a DataSet when it is disconnected from the source and is not dependent on the availability of the data source. The DataSet maintains information about the changes made to data so that updates can be tracked and sent back to the database as soon as the data source is available or reconnected.

Chapter 6 covers LINQ to XSD. It enhances XML programming by adding the feature of typed views on un-typed XML trees. LINQ to XSD gives a better programming environment by providing the object models generated from XML schemas. This is called typed XML programming.

Chapter 7 looks at standard query operators provided by LINQ, and how you can use some of them against different data sources.

Authors

Table of Contents

Chapter 1: Overview
LINQ Architecture
Integration with SQL
Integration with XML
Support for C# 3.0 Language Features
Summary
Chapter 2: LINQ to Objects
Array of Integers
Collection of Objects
Reading from Strings
Reading from Text Files
Summary
Chapter 3: LINQ to XML
Features
Class Library
LINQ to XML with Other XML Technologies
XML Names
Loading and Traversing XML
Data Manipulation
Outputting and Streaming XML
Querying XML
Writing XML as Text Files and CSV Files
Reading from CSV Files
LINQ to XML Events
XML Literals and Embedded Expressions in Visual Basic
Summary
Chapter 4: LINQ to SQL
Working with Databases Using DataContext
Entity Classes
Creating and Deleting Databases
DataContext Methods
Data Manipulation
LINQ to SQL Queries
Object Relational Designer (O/R Designer)
Summary
Chapter 5: LINQ over DataSet
Loading Data into DataSets
Querying Datasets
Sequence Operator
Querying Typed DataSets
DataSet Query Operators
Projection
Join
SequenceEqual
Skip
Distinct
Summary
Chapter 6: LINQ to XSD
Un-typed XML
Typed XML
Creating Typed XML using Visual Studio
Customization of XML Objects
Using LINQ to XSD at Command Line
Summary
Chapter 7: Standard Query Operators
Restriction Operators
Projection Operators
Join Operators
Concatenation Operator
Ordering Operators
Set Operators
Grouping Operators
Conversion Operators
Equality Operators
Generation Operators
Quantifiers
Aggregation Operators
Partitioning Operators
Element Operators
List of Query Operators
Summary

Book Details

ISBN 139781847192547
Paperback252 pages
Read More

Read More Reviews

Recommended for You

Drupal 7 Module Development Book Cover
Drupal 7 Module Development
$ 26.99
$ 18.90
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Drupal E-commerce with Ubercart 2.x Book Cover
Drupal E-commerce with Ubercart 2.x
$ 26.99
$ 18.90
GlassFish Security Book Cover
GlassFish Security
$ 26.99
$ 18.90
Drupal 7 Book Cover
Drupal 7
$ 26.99
$ 18.90
Drupal 7 Themes Book Cover
Drupal 7 Themes
$ 23.99
$ 16.80