Hi All,
Good Morning,
I’m facing issue on Invoke code, My Business process is Read Excel and add two rows and write in sample excel sheet by using Invoke code in VB.net
Dim row As DataRow
Dt1.Columns.Add(“English”)
For Each row In Dt1.Rows
DT2= (CInt(row(“English”)).ToString)+(CInt(row(“Tamil”)).ToString)
Next row
This my code. If any changes is there kindly intimate me.
Kindly gave solution.
Regards,
Santhosh Kumar M
Yoichi
(Yoichi)
December 5, 2022, 5:51am
2
Hi,
Can you share content of $exceptionDetails in Locals panel?
And also share what you want to achieve with input and expected output?
Regards,
Hi Yoichi,
Good Morning!
PFA and i need to add English and tamil row update with Total_Mark column by using Invoke Code.
Regards,
Santhosh Kumar
New Microsoft Excel Worksheet.xlsx (8.6 KB)
Gokul001
(Gokul Balaji)
December 5, 2022, 6:10am
4
Hi @Santhosh_Kumar3
How about this expression?
(From d In Dtread.AsEnumerable
Group d By k=d("Name").ToString.Trim Into grp = Group
Let sum = grp.Sum(Function (x) CDbl(x("English").toString.Trim)+CDbl(x("Tamil").toString.Trim))
Let ra = New Object(){k,grp.First()(1),grp.First()(2),sum}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable
Check out the XAML file
Total&AVG.xaml (9.1 KB)
Output Snap
Regards
Gokul
Gokul001
(Gokul Balaji)
December 5, 2022, 6:12am
5
Hi @Santhosh_Kumar3
Add this Write Range activity too in the XAML file.
Regards
Gokul
Hi,
Kindly explain this Vb Script.
regards,
Santhosh
Yoichi
(Yoichi)
December 5, 2022, 6:18am
7
Hi,
If you need to just update Total_Mark column, the following will work.
Dim row As DataRow
For Each row In Dt1.Rows
row("Total_Mark")= CInt(row("English"))+CInt(row("Tamil"))
Next row
Sample20221205-7.zip (8.7 KB)
Regards,
Gokul001
(Gokul Balaji)
December 5, 2022, 6:19am
8
Gokul001:
How about this expression?
(From d In Dtread.AsEnumerable
Group d By k=d("Name").ToString.Trim Into grp = Group
Let sum = grp.Sum(Function (x) CDbl(x("English").toString.Trim)+CDbl(x("Tamil").toString.Trim))
Let ra = New Object(){k,grp.First()(1),grp.First()(2),sum}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable
This is the LINQ expression and check out this tutorial @Santhosh_Kumar3
LINQ (Language-Integrated Query) is part of the .NET framework and offers capabilities for interacting with data, objects, or other sources within a particular syntax. This HowTo elaborates on the availability of LINQ and explores the offered functionalities
Current Version of this topic is DRAFT and will be finalized / enhanced soon
Introduction
Let’s recap the Example of LINQ from [HowTo] - First Start with LINQ (VB.Net) .
Sample data:
myNumbers | List (Of Int32) = {12,34,5,8,10,2,15,7}.to…
Regards
Gokul
Hi All,
Thanks for your support and I got answer by different method.
Thanks All,
Regards,
Santhosh Kumar M
1 Like
system
(system)
Closed
December 8, 2022, 6:32am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.