title: Left Join in Linq and using the variable for other joins
body: <p>I am stuck with the error "value cannot be null. parameter name row" when I use Left join in Linq for DataSet.</p>
  
  <p>Following is the data and the linq query.</p>
  
  <p><UL>
  <LI>DataRowCollection - items (Columns - Item_id, SKU, Quantity)</LI>
  <LI>DataRowCollection - promotions (Columns - Item_id, Promotion_Id)</LI>
  <LI>DataRowCollection - components (Columns - Component_id, Promotion_id)</LI>
  <LI>DataRowCollection - amounts (Columns - Component_id, Amount_Text, currency)</LI>
  </UL></p>
  
  <pre><code>        var q = 
              from Item in items
              join promotion in promotions
                  on Item.Field&lt;int&gt;("Item_id") equals promotion.Field&lt;int?&gt;("Item_id") into promo
              from promotion in promo.DefaultIfEmpty()
              join disccomponent in components
                  on promotion.Field&lt;int&gt;("Promotion_Id") equals disccomponent.Field&lt;int?&gt;("Promotion_Id")
              join discamounts in amounts
                  on disccomponent.Field&lt;int&gt;("Component_id") equals discamounts.Field&lt;int?&gt;("Component_id")
              where disccomponent.Field&lt;string&gt;("Type") == "Principal"
              select new
              {
                  SKU = Item.Field&lt;string&gt;("SKU"),
                  Quantity = Item.Field&lt;string&gt;("Quantity"),
                  DiscountAmount = discamounts.Field&lt;string&gt;("Amount_Text"),
                  DiscountCurrency = discamounts.Field&lt;string&gt;("currency")
              };
  </code></pre>
  
  <p>I need to get the following:
  <UL>
  <LI>SKU, Qty and Discount details for items which have discount</LI>
  <LI>SKU, Qty for items which do not have any discount</LI>
  </UL></p>
  
  <p>The code worked without left outer join when all items had discount, but if any item does not have any discount it skips that item and hence I had to use the left outer join.</p>
  
  <p>Any help is highly appreciated. Please let me know if any clarification is needed.</p>
  
  <p>Thanks in advance.</p>