Hi all,
I need your precious help to resolve the expression below intended to return two set of data based on 2 independant Equals.
I encounter an error of type: ‘Range variable name can not match the name of a member of the ‘Object’ class.’
can it be done in one go or do I have to do it in 2?
Thanks for your help.
(From row1 In Filtered_F.AsEnumerable
Join row2 In dt_Parametre2.AsEnumerable
On row1(“BANNIERE”).ToString Equals row2(“BANNIERE”).tostring
Let unitValue = row2(“Unit”).ToString
Let profitValue = row2(“Centre profit”).ToString
Let cptValue = (From row3 In Filtered_F.AsEnumerable
Join row4 In dt_Parametre2.AsEnumerable
On row3(“MDT_IMM_DIF”).tostring Equals row4(“MDT_IMM_DIF”).tostring
Select row3(“Compte Comptable”).ToString)
Let mappedValues = (From col In DT_Template_Fac.Columns.Cast(Of System.Data.DataColumn)
Let colName = col.ColumnName
Select If(colName = “Code Société”, unitValue,
If(colName = “Centre de profit”, profitValue,
If(colName = “Compte Comptable”, cptValue, Nothing)))
).ToArray()
Select DT_Template_Fac.LoadDataRow(mappedValues, True)
).CopyToDataTable()