/*See last 3 lines of my question for my explanation of how my question is different than the suggested possible duplicate. */
I'm trying to join 3 DataTables together using Linq.
Let's say the DataTable names are table1, table2, and table3 Let's say each Datatable has 6 columns, and the column names are col1, col2, col3, col4, col5, and col6.
I want to join these tables where col1,col2,col3, and col4 match.
I want to append columns 5 and 6 from tables 2 and 3 to table1, resulting in a table4 that has 10 columns and all records whether matching or not (null if not matching).
I've researched this most of the morning and can't seem to wrap my head around it. I was going to put my attempt at the code below but I think all it would do is confuse people. Thank you in advance for any help. I hope I gave enough info.
EDIT: I'm going to put my attempt at the code below. I couldn't even get any join to work, much less all tables:
var table4 = from one in Table1 join two in Table2 on one.col1 equals two.col1, one.col2 equals two.col2, one.col3 equals two.col3, one.col4 equals two.col4
select new { one.col1, two.col1, one.col2, two.col2, one.col3,two.col3,one.col4,two.col4};
my question is unique from the suggested duplicate due to the below: 1. that question addresses joining lists not DataTables 2. that question addresses joining based off matching one column not multiple