/[AnywhereTS-MSSQL]/trunk/AnywhereTS.DBSupport/DBConnector.cs
ViewVC logotype

Diff of /trunk/AnywhereTS.DBSupport/DBConnector.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/AnywhereTS.DBSupport/DBConnector.cs	2012/07/15 02:55:20	131
+++ trunk/AnywhereTS.DBSupport/DBConnector.cs	2012/07/15 03:09:38	132
@@ -152,6 +152,11 @@
             //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}
             catch (SqlException ex)
             {
+                if (ex.Message.ToLower().Contains(string.Format("Cannot open database").ToLower()))
+                {
+                    ErrorInfo = null;
+                    return;
+                }
                 using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", ex.Number.ToString(), ex.Message, System.Environment.NewLine, ex.ToString())))
                 {
                     Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));
@@ -160,6 +165,11 @@
             }
             catch (Exception ex)
             {
+                if (ex.Message.ToLower().Contains(string.Format("Cannot open database").ToLower()))
+                {
+                    ErrorInfo = null;
+                    return;
+                }
                 using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
                 {
                     Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));

 

  ViewVC Help
Powered by ViewVC 1.1.22