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 |
|
{ |
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 |