/[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/12 13:01:44	45
+++ trunk/TSAdminTool/Database.cs	2012/07/12 14:17:14	46
@@ -204,8 +204,12 @@
                 }
             }
             catch (SqlException sql_ex)
-            {
+            {              
                 MessageBox.Show(sql_ex.Number.ToString() + " " + sql_ex.Message.ToString());
+                using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", sql_ex.Number.ToString(), sql_ex.Message, System.Environment.NewLine, sql_ex.ToString())))
+                {
+                    Logging.ATSAdminLog.Error("Failed to RunScript");
+                }
                 return false;
             }
 
@@ -366,6 +370,10 @@
             catch (Exception e)
             {
                 MessageBox.Show("Cannot set access rights for users to the database. Do you have the sufficient rights? Application will abort. Error: " + e.Message);
+                using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                {
+                    Logging.ATSAdminLog.Fatal("Cannot set access rights for users to the database.");
+                }
                 Application.Exit();
                 return;
             }
@@ -387,6 +395,10 @@
             catch (Exception e)
             {
                 MessageBox.Show("Could not start the SQL Browser service (13078). Error:" + e.Message);
+                using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                {
+                    Logging.ATSAdminLog.Error("Could not start the SQL Browser service (13078).");
+                }
             }
         }
 
@@ -405,9 +417,13 @@
 
                 }
             }
-            catch
+            catch(Exception e)
             {
                 MessageBox.Show("Error, could not configure SQL Browser service (24888). Please check that SQL Server is intalled and that you are logged in with sufficient rights to configure services. Then retry the operation.");
+                using (log4net.NDC.Push(string.Format("SqlException: MESSAGE={0}{1}Diagnostics:{1}{2}", e.Message, System.Environment.NewLine, e.ToString())))
+                {
+                    Logging.ATSAdminLog.Fatal("Could not configure SQL Browser service (24888). Please check that SQL Server is intalled and that you are logged in with sufficient rights to configure services. Then retry the operation.");
+                }
             }
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22