/[AnywhereTS-MSSQL]/trunk/TSAdminTool/Database.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/Database.cs

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

--- trunk/TSAdminTool/Database.cs	2012/07/15 02:55:20	131
+++ trunk/TSAdminTool/Database.cs	2012/07/15 03:09:38	132
@@ -50,8 +50,9 @@
                     }
                     catch (Exception ex)
                     {
+                        Exception e = ex;
                         try
-                        {
+                        {                           
                             conn.CloseConnection(out ErrorInfo);
                             using (MsSqlConnector conn1 = new MsSqlConnector(ProSupport.strDatabaseServer, ProSupport.strDatabaseInstance, "master"))
                             {
@@ -77,16 +78,24 @@
                                 }
                                 catch (Exception ex1)
                                 {
-                                    if (ErrorInfo == null) { ErrorInfo = new Exception(ex1.Message, ex); throw ErrorInfo; }
+                                    e = ex1.GetBaseException();
+                                    if (ErrorInfo == null) { ErrorInfo = e;}
+                                    throw ErrorInfo; 
                                 }
                             }
                         }
                         catch (Exception ex1)
                         {
-                            if (ErrorInfo == null) { ErrorInfo = new Exception(ex1.Message, ex); }
+                            e = ex1.GetBaseException();
+                            if (ErrorInfo == null) { ErrorInfo = e; }
+                            throw ErrorInfo; 
+                        }
+                        e = ex.GetBaseException();
+                        if (!e.Message.ToLower().Contains(string.Format("Cannot open database \"{0}\" requested by the login",ATSGlobals.strDatabaseName).ToLower()))
+                        {
+                            if (ErrorInfo == null) { ErrorInfo = e; }
                             throw ErrorInfo;
                         }
-                        throw ErrorInfo;
                     }
                 }
                 #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22