I was trying to insert more than 20,000 record data in database using LINQ.
Almost everything is fine until the line of SubmitChanges. It slows down my application. I tried commenting the submitchanges, the program is done in just about 1-3 minutes. But with SubmitChanges being executed, it took almost 2 hours to finish.
For reference:
The application will read a almost 1,000 text file. Each text file has a number of records that need to be inserted in the database.
Additional:
The submitchanges is located outside the loop.
I tried Execute Command and using stored procedure, but to no avail.
Noname is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.