From 3fa8a7e9bedc9f009151cf97b0f6a24f35d53052 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 20 Aug 2013 19:53:42 +0000 Subject: [PATCH] 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 --- PROMS/DataLoader/DocVersions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PROMS/DataLoader/DocVersions.cs b/PROMS/DataLoader/DocVersions.cs index 38616fb3..0fa947ae 100644 --- a/PROMS/DataLoader/DocVersions.cs +++ b/PROMS/DataLoader/DocVersions.cs @@ -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) {