I'm reading the Excel sheet and applying My business logic and i'm trying to insert using Linq to SQL
.
In my loop i have > (greater than) 5,000 records
and < (Less than) 15,000 records
to Insert.
public List<tblLog> tblLogList = new List<tblLog>();
This Method is Inside the Looping:
public void SaveLog()
{
tblLog tnlog = new tblLog();
tnlog.id = Guid.NewGuid();
tnlog.comp_id = Comp_id;
tnlog.branch_id = Branch_id;
tnlog.row_id = rowID;
tnlog.his_id = his_id;
//Add records to List
tblLogList.Add(tnlog);
Earlier i have tried this code to submit 1 by one:
//_trContext.tblLogs.InsertOnSubmit(tblLog);
//_trContext.SubmitChanges();
Due to the Performance hit i have changed InsertOnSubmit
to InsertAllOnSubmit
if (tblLogList.Count >= 1000)
{
_trContext.tblLogs.InsertAllOnSubmit(tblLogList);
_trContext.SubmitChanges();
tblLogList.Clear();
}
}
Here my question is:
What is the Maximum Number Records i can insert through InserAllOnSubmit() In Linq to Sql.
Through my above code i achieved up to 1000 records but i swear while the code goes for 10,000 or more records it might through some
Timeout Exception
since its implemented in my**windows service**
.I'm realy confused, what were the best suggestions to handle the above logic.?
Thanks in Advance.