using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication5 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { var x = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var y = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I"}; var data = new[] { new {X = 0, Y = "A", Value = "0A"}, new {X = 2, Y = "B", Value = "2B"}, new {X = 5, Y = "F", Value = "5F"}, new {X = 8, Y = "A", Value = "8A"} }; var result = from a in x from b in y join c in data.DefaultIfEmpty() on a + b equals c.X + c.Y into d let f = d.FirstOrDefault() select new { X = a, Y = b , Value = (f == null ? "" : f.Value) }; MessageBox.Show(string.Join("\r\n", result)); } } }