title: Non-Nullable value type issue when LEFT JOIN in Linq
body: <p>I am going to work on a WinForms project which requires to use <strong>Linq</strong>, but I know nothing about it, so I just started learning. </p>
  
  <p>After reading a tutorial about Linq I created the <code>System.Data.Linq.DataContext</code> using the <code>SqlMetal</code> tool which comes with the Microsoft Windows SDK. The database Im using as example is <strong>"Northwind"</strong>.</p>
  
  <p>I have been able to make simple queries as following:</p>
  
  <pre><code>Northwind db = new Northwind("Data Source=local;Initial Catalog=Northwind;Integrated Security=True");
  
  var query = from c in db.Customers
              join o in db.Orders on c.CustomerID equals o.CustomerID 
              select new
              {
                  Customer_ID = c.CustomerID,
                  Customer_Name = c.ContactName,
                  Order_ID = o.OrderID
              };
  </code></pre>
  
  <p>And then I show the results in a <code>DataGridView</code> and everithing goes well.</p>
  
  <p>But right now I am facing a problem which I havent been able to solve. </p>
  
  <p>I tried to modify the previous query in order to make a <code>LEFT OUTER JOIN</code>, so what I did was the following:</p>
  
  <pre><code>    var query = from c in db.Customers
              join o in db.Orders on c.CustomerID equals o.CustomerID into j
              from or in j.DefaultIfEmpty()
              select new
              {
                  Customer_ID = c.CustomerID,
                  Customer_Name = c.ContactName,
                  Order_ID = or.OrderID
              };
  </code></pre>
  
  <p>But, when I try to show these set of data in a <code>DataGridView</code> an error is raised:</p>
  
  <pre><code>The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type.
  </code></pre>
  
  <p>I know this problem is caused by the "Customers" that dont have a "Order", so the system tries to asign a <code>null</code> value to a <code>int</code> variable. </p>
  
  <p>But then, <strong>How can I make a <code>LEFT OUTER JOIN</code> without having this error?</strong></p>
  
  <p>Thank you in advance.</p>