//---------------Wrting query for join between two data tables for Single Field---------------//
var result = from dataRows1 in dtJoiningWithTwoSeries.AsEnumerable()
join dataRows2 in dtTimeSeriesForCmbFinal.AsEnumerable()
on
dataRows1.Field<string>("DateOnly") equals dataRows2.Field<string>("Date")
select dtJoinForSingleField.LoadDataRow(new object[]
{
dataRows1.Field<string>("DateOnly"),
dataRows1.Field<string>("TimeOnly"),
dataRows1.Field<decimal>("Series 1"),
dataRows1.Field<decimal>("Series 2"),
dataRows2.Field<decimal>("Value"),
dataRows2.Field<string>("Date")
}, false);
//---------------copy output of result into datatable named 'dtJoinForSingleField'---------------//
dtJoinForSingleField = result.CopyToDataTable(); // This point records will be loaded in dtJoinForSingleField data table
var result = from dataRows1 in dtJoiningWithTwoSeries.AsEnumerable()
join dataRows2 in dtTimeSeriesForCmbFinal.AsEnumerable()
on
dataRows1.Field<string>("DateOnly") equals dataRows2.Field<string>("Date")
select dtJoinForSingleField.LoadDataRow(new object[]
{
dataRows1.Field<string>("DateOnly"),
dataRows1.Field<string>("TimeOnly"),
dataRows1.Field<decimal>("Series 1"),
dataRows1.Field<decimal>("Series 2"),
dataRows2.Field<decimal>("Value"),
dataRows2.Field<string>("Date")
}, false);
//---------------copy output of result into datatable named 'dtJoinForSingleField'---------------//
dtJoinForSingleField = result.CopyToDataTable(); // This point records will be loaded in dtJoinForSingleField data table
No comments:
Post a Comment