ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/TSAdminTool/Database.cs
(Generate patch)

Comparing trunk/TSAdminTool/Database.cs (file contents):
Revision 131 by william, Sun Jul 15 02:55:20 2012 UTC vs.
Revision 132 by william, Sun Jul 15 03:09:38 2012 UTC

# Line 50 | Line 50 | namespace AnywhereTS
50                      }
51                      catch (Exception ex)
52                      {
53 +                        Exception e = ex;
54                          try
55 <                        {
55 >                        {                          
56                              conn.CloseConnection(out ErrorInfo);
57                              using (MsSqlConnector conn1 = new MsSqlConnector(ProSupport.strDatabaseServer, ProSupport.strDatabaseInstance, "master"))
58                              {
# Line 77 | Line 78 | namespace AnywhereTS
78                                  }
79                                  catch (Exception ex1)
80                                  {
81 <                                    if (ErrorInfo == null) { ErrorInfo = new Exception(ex1.Message, ex); throw ErrorInfo; }
81 >                                    e = ex1.GetBaseException();
82 >                                    if (ErrorInfo == null) { ErrorInfo = e;}
83 >                                    throw ErrorInfo;
84                                  }
85                              }
86                          }
87                          catch (Exception ex1)
88                          {
89 <                            if (ErrorInfo == null) { ErrorInfo = new Exception(ex1.Message, ex); }
89 >                            e = ex1.GetBaseException();
90 >                            if (ErrorInfo == null) { ErrorInfo = e; }
91 >                            throw ErrorInfo;
92 >                        }
93 >                        e = ex.GetBaseException();
94 >                        if (!e.Message.ToLower().Contains(string.Format("Cannot open database \"{0}\" requested by the login",ATSGlobals.strDatabaseName).ToLower()))
95 >                        {
96 >                            if (ErrorInfo == null) { ErrorInfo = e; }
97                              throw ErrorInfo;
98                          }
89                        throw ErrorInfo;
99                      }
100                  }
101                  #endregion

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines