I am reading the Excel sheet and applying my business argument and I In my loop I have This method is inside looping: Before I tried to submit this code one by one: Due to the performance hit, I changed the Here's my question: Maximum number of records I can insert through InserAllOnSubmit (In SQL in the link. Through the code given above I have achieved 1000 records, but I swear when code goes for 10,000 or more records This is some I'm really confused, What were the best suggestions for handling the above logic? Thanks in advance. While others have a right to say that there is a better solution for this task, there is a direct answer to your question so far. The answer is That the technically number is limited to the amount of memory, the context swallows all these new items, or the maximum size database transactions Oggs are more likely to be interrupted, but you can stop them from reaching both the boundaries by recording hundreds of thousands or thousands of amounts for each batch and using a new reference (!) You can. As you said, there can be a practical limit command time-out (if you do not want to make it infinite) it can also be affected by cuts in batches , And thus, starting a new order for each batch. The functional range depends on things such as the process is inaccessible or not the patience), and whether the data is expected to be available within a certain time. If these requirements are tight, then you may have to resort to one of the solutions given in other answers. LINQ to SQL .
& gt; (More than 5000 records) and
& lt; Insert (less than) 15,000 records .
Public List & lt; TblLog & gt; TblLogList = New list & lt; TblLog & gt; ();
Public Zero SaveLog () {tblLog tnlog = new tblLog (); Tnlog.id = Guide. Newguide (); Tnlog.comp_id = Comp_id; Tnlog.branch_id = Branch_id; Tnlog.row_id = rowID; Tnlog.his_id = his_id; // Add a record to the list of tblLogList.Add (tnlog);
//_trContext.tblLogs.InsertOnSubmit (TblLog); // _ trContext.SubmitChanges ();
InsertOnSubmit to
InsertAllOnSubmit
if (tblLogList Count & gt; = 1000) {_trContext.tblLogs.InsertAllOnSubmit (tblLogList); _trContext.SubmitChanges (); TblLogList.Clear (); }}
timeout exception because it has been applied to my
** windows service ** .
No comments:
Post a Comment