Write the data table to excel sheet based on if conditions

Hi All,

Can anyone please let me know , how to write the data table to excel sheet based on if conditions.
U1
For Eg., I need to update the column(salary) for Emp whose ID is 1 and 4(based on current month) and update the excel sheet with the updated values.

Thanks In Advance.

Hi ,

  1. The Linq can be used to Update the Columns in the Datatable .
  2. Then Write range can be used to write Output to Excel.

Can you elaborate the Scenario to Update the salary Column for Linq .

Need to check for the current month and update the salary column for Emp ID 1 and 4

Hi ,

write-the-data-table-to-excel-sheet-based-on-if-conditions.xaml (8.5 KB)

I want without using the linq code. Can you please help me in it.
And i want in excel sheet which row the data should be inserted into. Like starting from A2

@ppratz

Check below post for your reference how you can write to datatable

Hope this helps you

Thanks