How to match Input columns --CompanyCode ,Id, Date is variable with database excel columns–CompanyCode ,Id,Date
If Match found ,need to check Statement sent Column in data base with yes value if it is true need to update reference Column in dataBase in Input Excel
Output
output CompanyCode 1234 ,Id 56789, Date 30.02.2024 that should match and again need to check Database StatementSent Column if found Yes need to update Reference in input excel (ReferenceNumber 123
LinQ:
(From row In dt_Database
Join main In dt_InputTable
On row(“CompanyCode”).ToString Equals main(“CompanyCode”).ToString And row(“ID”).ToString Equals main(“ID”).ToString
Let ReferenceNo = If(row(“StatementSent”).ToString.Trim.ToLower.Contains(“yes”),row(“ReferenceNumber”).ToString.Trim,“”)
Select dt_Output.Rows.Add({row(“CompanyCode”).ToString,row(“ID”).ToString,ReferenceNo,row(“StatementSent”).ToString})
).CopyToDatatable