I am updating large number of records one by one using c sharp. The requirement is such that I have to write sql query in c sharp. Requirement compare records from table 1 with records in table 2 on the basis of Id,if found in table 2 update in table1,not found set message Id does not exists,if got exception update exception message and this I am doing one by one by using foreach loop to compare. But In case of large number of records it takes time for 100000 records it takes 2 Hours,how to use multitasking to make processing faster.
Loading


Priyanka K SRank #1,385 · 1.2K reputationPosted Oct 7, 2021, 4:48 AM EDT
//used by LINQ to SQL public static IQueryable Page(this IQueryable source, int page, int pageSize) { return source.Skip((page - 1) * pageSize).Take(pageSize); } Now you have multiple task , run all tasks concurrently. await Task.WhenAll(tasks);I just try give you rough picture how we can solve this problem.Hope this helps!!Mahesh ChandRank #1 · 393.3K reputationPosted Oct 6, 2021, 10:40 PM EDT
Satish VishwakarmaRank #6,677 · 259 reputationPosted Oct 7, 2021, 2:00 AM EDT
Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Oct 7, 2021, 2:26 AM EDT