E10 UDtable dataview join with another

You should be able to LINQ your datasets

(an example stolen from MSDN)

Just setting up the example structures (in your case it’s already done)

DataSet ds1 = new DataSet("ds1");

DataSet ds2 = new DataSet("ds1");

DataTable dt1 = new DataTable("Table1");

DataTable dt2 = new DataTable("Table2");

 

ds1.Tables.Add(dt1);

ds2.Tables.Add(dt2);

dt1.Columns.Add("id", Type.GetType("System.Int32"));

dt1.Columns.Add("FirstName", Type.GetType("System.String"));

dt1.Rows.Add(1, "Carl");

dt1.Rows.Add(2, "John");

 

dt2.Columns.Add("key", Type.GetType("System.Int32"));

dt2.Columns.Add("id", Type.GetType("System.Int32"));

dt2.Columns.Add("LastName", Type.GetType("System.String"));

dt2.Rows.Add(1, 1, "Perry");

dt2.Rows.Add(2, 2, "Piercy");

dt2.Rows.Add(3, 4, "Johnson");

 

<— THE TASTY STUFF —>

IEnumerable<DataRow> dv = from table1 in ds1.Tables[0].AsEnumerable()

from table2 in ds2.Tables[0].AsEnumerable()

where table1.Field<int>("id") == table2.Field<int>("id")

select table2;

//select new { id = table1.Field<int>("id"), firstname = table1.Field<string>("FirstName"), lastname = table2.Field<string>("LastName")};

dataGridView1.AutoGenerateColumns = true;

dataGridView1.DataSource = DataTableExtensions.CopyToDataTable<DataRow>(dv);

As far as the editing goes - Off the top of my head, I dont see a way around custom handling of the field changes from the linq’d table back to the original