I have 2 datatables:
_wizardStepSelectUnitDataSet.WizardStepSelectUnits_UnitsSelectedInOtherAgreements
and
_wizardStepSelectUnitDataSet.WizardStepSelectUnits_SelectedUnits
The schemas are the same, I need to know which rows exist on both datatables,
How can I do that into a new datatable?
There is no CODE: I only have 2 datatables already designed. They are already filled with some data in memory.
I need to know which are the common rows between both datatables using one ID field.
I cant copy the code of the designer, you will be overwhelmed.
I tried this: var result = from r in _wizardStepSelectUnitDataSet.WizardStepSelectUnits_UnitsSelectedInOtherAgreements.AsEnumerable() join c in _wizardStepSelectUnitDataSet.WizardStepSelectUnits_SelectedUnits.AsEnumerable() on r.Field("UnitId") equals c.Field("UnitId") select r;
DataRow[] dr = result.Select(
String.Format(CultureInfo.InvariantCulture.DateTimeFormat,"StartDate <= #{0}#", stopDate));
However I got a compiler error: Error 7 The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. C:\BITProjects\TeamSystem\luival\refm\DEV\AgreementModule\GUI\WorkItems\UC021_HuurovereenkomstWizard_WorkItem.cs 511 28 Ceusters.REFM.AgreementModule.GUI
Thank you