My LINQ Articles

I have been doing some LINQ/DLINQ articles over at codeproject.

Codeproject article link :LINQ Introduction 1 of 3

Heres a small taster of some of the LINQ standard query operators I discuss
in the article (the acticle does them all)


var iSmall = 
    from it in _itemList 
    where it.UnitPrice < 50.00M 
    select it;


 var namesAndPrices = 
     _itemList.Where(i => i.UnitPrice >= 10). 
Select(i => new { i.ItemName,i.UnitPrice }).ToList();


var MostExpensive2 = _itemList. 
OrderByDescending(i => i.UnitPrice).Take(2);


var itemOrders =    from i in _itemList 
join o in _orderList on i.ItemID equals o.OrderID 
select new { i.ItemName, o.OrderName };


var itemNamesByCategory =    from i in _itemList 
group i by i.Category into g 
select new { Category = g.Key, Items = g };


var inter = (from i in _itemList select i.ItemID).Distinct() 
.Intersect((from o in _orderList select o.OrderID).Distinct());


var query = _itemList.ToArray(). 
Where(i => i.Category.Equals"Food"));


var foodCat = (from i in _itemList 
where i.Category.Equals("Food")  

select i).Count();


var totals = (from i in _itemList select i.UnitPrice).Sum();

Thats really only a few of the LINQ standard query operator, there are many many more
mentioned at the article link at the top of this section.

Ive also be doign some DLINQ stuff, and done an article about that as well.

Codeproject article link :DLINQ Introduction 2 of 3

This article discusses the use of the DLINQ designer, the enitity code file generation using the SQLMetal.exe tool,
and also shows some standard DLINQ queries and updates in action

I’ve even attracted the attention of a Mr Joe Rattz, who is just about to publish a LINQ book his blog is here he liked my articles, as did the totally awesome Marc Clifton. So I must be something right. You decide.

Hope you like them



  1. Hello Sacha,

    Nice articles. I have linked them from NetFxGuide. Let me know about others that you think could be listed or, if you prefer, I can give you access to a small admin system to add them by yourself.




  2. Dear Sacha

    i had a question and i couldnt find your email anywhere so i am leaving my message in the comment box.

    I read your article on SQL Database Image Storage & Easy Thumbnails and it really helped me out in my web application. It was one of the best articles I had come across in the code project web site. But I have a problem. My table has other field and now when I want to update those other fields an error accrues:” String or binary data would be truncated”

    I don’t know what to do with this error. I have tried all I knew but it hasn’t changed. What I can’t understand is that I am not updating the image_data field, only some other field that shouldn’t affect the image_data field.

    I would be very thankful if you help me out on this.




  3. Sasha,

    I read your most recent WPF cropping component article.
    and i’m very interested in your work.

    Please send me an email direct to I would like to discuss what I do and possible ways that you may be able to help.

    I’m located in the USA and all of my work is also in the USA but there is some possibility that you may be able to help.

    Bob Ranck


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s