I have an operation that I need to run once using c#:
it's much more complicated than the code following but still something like this:
using (DB1DataContext db1 = new DB1DataContext())
{
int count = db1.tbale1.Count();
int currentIndex = 0;
while (currentIndex < count)
{
var obj= db1.table1s.Take(1).Skip(currentIndex).FirstOrDefault();
using (DB2DataContext db2 = new DB2DataContext())
{
tableA tb = new table1();
db2.tableAs.InsertOnSubmit(tb);
db2.SubmitChanges();
}
currentIndex++;
}
}
one loop takes about 500 millisecond and the number of loops is about 15000 which means the operation will take about 125 minutes.
will this work or is there some kind of problems??
Edit:As I mentioned before just want to know if there is any time limits that will stop the operation