Category Archives: LINQ
Book Review: LINQ In Action
LINQ In Action
Author: Fabrice Marguerie, Steve Eichert, Jim Wooley
Publisher: Manning
No. Pages: 600
From Amazon
LINQ in Action is a fast-paced, comprehensive tutorial for professional developers. This book explores what can be done with LINQ, shows how it works in an application, and addresses the emerging best practices. It presents the general purpose query facilities offered by LINQ in the upcoming C# 3.0 and VB.NET 9.0 languages. A running example introduces basic LINQ concepts. You’ll then learn to query unstructured data using LINQ to XML and relational data with LINQ to SQL. Finally, you’ll see how to extend LINQ for custom applications.
I just finished the book LINQ In Action. All I can say is wow. There is so much to cover with this technology and this book does a very good job of doing just that.
The book starts off with the origins and goals of LINQ then jumps right in with how to use and extend it. Most if not all aspects of LINQ to Objects, LINQ to SQL and LINQ to XML are all covered very well. The examples are easy to follow and understand which is important for me as I tend to learn from replicating the samples. Most of the code snippets are in C#, but there are some VB.NET samples as well (where XML Literals are discussed).
The level of the book ranged from fairly easy to understand to advanced topics. In my opinion, just about every level of developer should learn something from this book. The parts I did not understand will come later as I will be referencing this book for the foreseeable future.
HDNUG Meeting – 04/10/08 – Recap
I attended the Houston .NET User Group meeting Thursday night where there was a great turnout of well over 100 people. The sponsor was Clearpoint Technology.
The presentation was given by Mohammad Azam and the topic was LINQ to SQL and Gotchas. Mohammad is a very interesting presenter and really knows his stuff. He is what I like to call a coding presenter. A presenter that codes their samples on the spot and does not have a ton of slides in the slide deck. Although, he did present his first slide that read “Slide 1 of 347″ (or something like that) as a joke to break the ice. Well it worked, he had the whole room laughing.
Below are some of the items/points presented.
- CRUD operations using LINQ to SQL
- The DelayLoaded property in the data designer
- Data load options
- LINQ to SQL as an alternative to calling Stored Procedures from C# code
- Anonymous Data Types
Mohammad finished the presentation by going over some of the problems he encountered while working with LINQ to SQL.
There was a plethora of information in the presentation – so much it was difficult to note everything.
–
Related Content
- My Presentation at Houston .NET User Group on LINQ to SQL – Mohammad Azam
- Houston .NET User Group Meeting LINQ to SQL Demo Downloads! – Mohammad Azam
LINQ Samples and Resources
LINQ stands for Language INtegrated Query. It is a native querying syntax that allows languages such as C# and VB.NET to filter and enumerate through collections. For example, arrays, data sets and relational databases.
Below are a couple of simple examples as well as some great resources.
–
Sample #1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinqTest
{
class Program
{
static void Main(string[] args)
{
string[] states = { "TX","LA","FL","AZ","TN","AK"};
var stateList =
from s in states
select s;
Console.WriteLine("State List:");
foreach (var state in stateList)
{
Console.WriteLine(state);
}
}
}
}
Result

–
Sample #2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinqTest
{
class Program
{
static void Main(string[] args)
{
string[] states = {"TX","LA","FL","AZ","TN","AK"};
var stateList =
from s in states
where s.Substring(0,1) == "A"
select s;
Console.WriteLine("State List:");
foreach (var state in stateList)
{
Console.WriteLine(state);
}
}
}
}
Result

–
Great Resources for LINQ
- LINQ Articles from Scott Guthrie
- Visual Studio 2008 Samples
- 101 LINQ Samples
- Understanding LINQ (C#) – via Amro Khasawneh (Code Project)
–









