im doing a join on 2 datatables and the result is 800k and something lines.
this is ok so far.....my question is, when i do a foreach and go throu all the lines of the result.....every index of the for it querys the linq statement again, making it very heavy.
is there any other way to do this with linq?
if i do this with nested loops working direcly with the datatables, the code is ugly and messi but its a lot faster.
ruipedromach...
Member
258 Points
84 Posts
Linq joining 2 datatables and result 800k
Aug 17, 2012 08:41 PM|LINK
hi all
im doing a join on 2 datatables and the result is 800k and something lines.
this is ok so far.....my question is, when i do a foreach and go throu all the lines of the result.....every index of the for it querys the linq statement again, making it very heavy.
is there any other way to do this with linq?
if i do this with nested loops working direcly with the datatables, the code is ugly and messi but its a lot faster.
thks in advanced
rgds
rui
ruipedromach...
Member
258 Points
84 Posts
Re: Linq joining 2 datatables and result 800k
Aug 17, 2012 09:39 PM|LINK
never mind , i figure it out
i created a composite object and did the linq result ToList of that object.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Linq joining 2 datatables and result 800k
Aug 19, 2012 02:02 AM|LINK
Congratulation! welcome to our forum next time!