Datatable Manipulation Using Invoke Code Activity with LINQ

I wanted to do Manipulating Datatable using LINQ.

Arguements for Invoke Code activity -

Input - dt_Customers DatatType - Datatable
Output - dt_Output
Dim queryResults = From cust In dt_customers
Where cust.Country = “Canada”
Select cust.CompanyName, cust.Country
dt_Output = queryResults.CopyToDataTable()


1.Error : BC30209 Option Strict On requires all variable declartions to have “As” clause
2.CopyToDataTable() - Converting to Enurable Row to Datatable
3. Column Name Country not availble in the datatable.

Please help me on this

Hi @kaliraj1982,
Please find the attached workflow
Main.xaml (5.3 KB)


@Gouda_6 - Thanks for your reply. But my goal is implement LINQ using code activity. Just I shaered sample error. My requirements is below,

  1. Read Excel(3 Sheets - PrevMonth(Columns: ID,Product,Citya and Sales), CurrentMonth(ID,Product,Citya and Sales) and Comments(ID,Product,City and Commets).
  2. Need to store all in Datatables.
  3. Concatenate Columns ID,Product,City as “Product Details” Column and Sum Sales GroupBy Product Details and stored in “Amount” Column.
  4. Remove duplicates.
  5. Compare Previous month sales Amount and Current Month Sales amount.[Sample_Input_Data.xlsx (14.9 KB)

Please find more details in attached excel.

1 Like

Hi Kaliraj,

Have you got this?

1 Like