ddrdushy1
(Dushyanth)
June 19, 2017, 9:37am
#1
Hi,
I need to join two tables using linq,
Dim vLINQ = (From DT1 In vDT1.AsEnumerable
Join DT2 In vDT2.AsEnumerable
On DT1.Field(Of String)("Key") Equals DT2.Field(Of String)("Key")
Select new with
{
.Key = DT1.Field(Of String)("Key"),
.Data1 = DT1.Field(Of String)("Data1"),
.Data2 = DT1.Field(Of String)("Data2"),
.Data3 = DT2.Field(Of String)("Data3"),
.Data4 = DT2.Field(Of String)("Data4")
}).ToList()
I used assign activity to achive this. UIPath showing error as
Option Strict On disallows late binding.
how I can Use this type of LINQ in UIPath?
3 Likes
Divyashreem
(Divyashree Muddagangaiah)
March 27, 2018, 6:34am
#2
Did you find any answer for this.?
arivu96
(Arivazhagan A)
March 27, 2018, 6:37am
#3
Hi @Divyashreem ,
@ddrdushy1
Refer this Post Join Two Data table
Hi All,
Use below code to remove empty row from the table.
DataTable name->DataTableName
Use assign activity
DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()
Re-usable Component pass Parameter as datatable you will get the answer.
RemoveEmptyRows.xaml (8.5 KB)
Remove rows based on particular column is empty.
DataTableName.Select("Convert(column3, System.String)< >''"…
Regards,
Arivu
2 Likes
Divyashreem
(Divyashree Muddagangaiah)
March 27, 2018, 6:52am
#4
i need to join 3 tables here, and i had written linq query but it is throwing an error
Divyashreem
(Divyashree Muddagangaiah)
March 27, 2018, 9:02am
#5
i got the solution thank you
priyatham
(priyatham)
May 21, 2018, 8:43pm
#6
Hi Divya,
Can you share the solution
Divyashreem
(Divyashree Muddagangaiah)
May 22, 2018, 8:08am
#7
Linq didnt, work for me as well, i used simple 3 for loops one inside the other.
Ranjith1996
(Ranjith Ratnala)
November 21, 2018, 11:19am
#8
Hi Divya,
Can you post the solution.
Divyashreem
(Divyashree Muddagangaiah)
November 21, 2018, 4:25pm
#9
i have used For loop inside another for loop that’s all.
Using Linq is possible for joining 3 data table. Please find the below sample query.
(from a in Company1 join b in Company2 on a (“EMPId”).Tostring() equals b (“EMPId”).Tostring() join c in Company3 on c.(“EMPId”).Tostring() equals b.(“EMPId”).Tostring()) select a)
1 Like
Hi,
I have two datatables with huge volume of data around 2 Lakhs (Min) in datatable 2 and around 1 lakh data in datatable 1. I need to compare three columns in two datatables , if all the values in two datatable matches, (account) column value from datatable 2 needs to be updated in the account column in datatable 1.Since the query is wrote is taking too much time. Help me to find a solution for this.
Regards,
Niranjanaa