/[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

revision 131 by william, Sun Jul 15 02:55:20 2012 UTC revision 132 by william, Sun Jul 15 03:09:38 2012 UTC
# Line 152  namespace AnywhereTS.DBSupport Line 152  namespace AnywhereTS.DBSupport
152              //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}              //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}
153              catch (SqlException ex)              catch (SqlException ex)
154              {              {
155                    if (ex.Message.ToLower().Contains(string.Format("Cannot open database").ToLower()))
156                    {
157                        ErrorInfo = null;
158                        return;
159                    }
160                  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())))                  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())))
161                  {                  {
162                      Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));                      Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));
# Line 160  namespace AnywhereTS.DBSupport Line 165  namespace AnywhereTS.DBSupport
165              }              }
166              catch (Exception ex)              catch (Exception ex)
167              {              {
168                    if (ex.Message.ToLower().Contains(string.Format("Cannot open database").ToLower()))
169                    {
170                        ErrorInfo = null;
171                        return;
172                    }
173                  using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))                  using (log4net.NDC.Push(string.Format("{0}: MESSAGE={1}{2}Diagnostics:{2}{3}", ex.GetType().Name, ex.Message, System.Environment.NewLine, ex.ToString())))
174                  {                  {
175                      Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));                      Logging.DatabaseLog.Error(string.Format("Failed to open connection to {0} Database", DBDatabase));

Legend:
Removed from v.131  
changed lines
  Added in v.132

  ViewVC Help
Powered by ViewVC 1.1.22