Hello everyone,
I have joined the following two tables as follows.
But after the join operation, the data changes place.
How can I fix this.
Thanks!
Hello everyone,
I have joined the following two tables as follows.
But after the join operation, the data changes place.
How can I fix this.
Thanks!
Correct me if I am wrong
your dt1:
your dt2:
your required output
sorry just trying to understand I can see your dt1 is same as output?
Sorry, I couldn’t express myself.
I want the result like the first datatable.
Order of data in first table
Alperen KEZAY
Zeynep KEZAY
Ahmet KEZAY
But output like this
Alperen KEZAY
Ahmet KEZAY
Zeynep KEZAY.
I don’t want the order of the data to change.
Hi,
Can you try to order the result using the following expression?
out_JoinDt.AsEnumerable.OrderBy(Function(r) Array.IndexOf( dataListesiDt.AsEnumerable.Select(Function(x) x("EmployeeName").ToString).ToArray(), r("EmployeeName").ToString)).CopyToDataTable()
Regards,
@MrKezay
the Join DataTable can have a result where the row orders are changed e.g. compared to dt1.
Lets assume we can rely to the email for identifying a particular row, then we can reorder the the join result by following:
Assign activity
left side: dtJoinOrdered | DataTable
Righ side:
(From d in out_JoinDT.AsEnumerable
let e = d(“EmployeeAdress”).toString
let i = dataListesiDT.AsEnumerable.toList.FindIndex(Function (x) x(EmployeeAdress).toString.Equals(e))
Order by i
Select d).CopyToDataTable
Thank you so much @ppr and @Yoichi
Both expressions are correct. Sorry Yoichi, Peter’s solution is more explanatory I’m flagging his solution.
Thank you again, I have a lot to learn from you.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.