fixed a TimeSpan overflow error where it added time spent on datasets that were not processed (happens when merging databases) and resulted in a number that made no sense for the time function, causing the program to stop

This commit is contained in:
John Jenko 2013-08-20 19:53:42 +00:00
parent e507230fd9
commit 3fa8a7e9be

View File

@ -40,7 +40,7 @@ namespace DataLoader
long lTime = DateTime.Now.Ticks;
string pth = docver.Title;
// if the Title is empty, return because this docversion has already been migrated.
if (pth == null || pth == "") return TimeSpan.FromTicks(lTime);
if (pth == null || pth == "" || pth == "Title") return TimeSpan.FromTicks(0);
MultiUnitCount = docver.DocVersionConfig.Unit_Count;
if (MultiUnitCount > 0)
{
@ -54,7 +54,8 @@ namespace DataLoader
New2OldApple.Add(i, oldindex);
}
}
if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return new TimeSpan(); // Open connection
if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return TimeSpan.FromTicks(0);
// Open connection
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
if (convertProcedures)
{