/[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/13 01:35:49	77
+++ trunk/TSAdminTool/Database.cs	2012/07/13 02:21:43	78
@@ -67,25 +67,25 @@
                 //bCreateDB = true;
                 try
                 {
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
-                    {
+                    //using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
+                    //{
                         Logging.ATSAdminLog.Debug(string.Format("Creating Database {0}", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                         RunScript(SQLServerResources.CreateDatabase);
                         //RunScript(CreateDatabaseUserScript());
                         sqlCon.Close();
-                    }
+                    //}
                     Logging.ATSAdminLog.Debug(string.Format("Created Database {0}", ATSGlobals.strDatabaseName));
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
-                    {
+                    //using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
+                    //{
                         Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                         RunScript(SQLServerResources.CreateTables);
                         //sqlCon.Close();
-                    }
+                    //}
                     Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database", ATSGlobals.strDatabaseName));
                 }
                 catch (SqlException sql_ex1)
@@ -290,38 +290,38 @@
                 {
 
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
-                    {
+                    //using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateDatabase)))
+                    //{
                         Logging.ATSAdminLog.Debug(string.Format("Creating Database {0} in CheckVersion()", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                         RunScript(SQLServerResources.CreateDatabase);
                         //RunScript(CreateDatabaseUserScript());
                         sqlCon.Close();
-                    }
+                    //}
                     Logging.ATSAdminLog.Debug(string.Format("Created Database {0} in CheckVersion()",ATSGlobals.strDatabaseName));
 
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
-                    {
+                    //using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
+                    //{
                         Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                         RunScript(SQLServerResources.CreateTables);
                         sqlCon.Close();
-                    }
+                    //}
                     Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
                 }
                 try
                 {
-                    using (log4net.NDC.Push(string.Format("SQL Statment={0}", "SELECT value from {0}..AppInfo where property='version'", ATSGlobals.strDatabaseName)))
-                    {
+                    //using (log4net.NDC.Push(string.Format("SQL Statment={0}", "SELECT value from {0}..AppInfo where property='version'", ATSGlobals.strDatabaseName)))
+                    //{
                         Logging.ATSAdminLog.Debug(string.Format("Getting {0} Database Version#1", ATSGlobals.strDatabaseName));
                         sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                         if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                         sqlCmd = new SqlCommand(string.Format("SELECT value from {0}..AppInfo where property='version'",ATSGlobals.strDatabaseName), sqlCon);
                         strResult = (string)sqlCmd.ExecuteScalar();
                         sqlCon.Close();
-                    }
+                    //}
                     Logging.ATSAdminLog.DebugFormat("{0} database version={1}",ATSGlobals.strDatabaseName, strResult);
                 }
                 catch(SqlException ex)
@@ -334,14 +334,14 @@
                     try
                     {
 
-                        using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
-                        {
+                        //using (log4net.NDC.Push(string.Format("SQL Statment={0}", SQLServerResources.CreateTables)))
+                        //{
                             Logging.ATSAdminLog.Debug(string.Format("Creating Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
                             sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace(ATSGlobals.strDatabaseName, "master"));
                             if (sqlCon.State != ConnectionState.Open) sqlCon.Open();
                             RunScript(SQLServerResources.CreateTables);
                             sqlCon.Close();
-                        }
+                        //}
                         Logging.ATSAdminLog.Debug(string.Format("Created Tables in {0} Database in CheckVersion()", ATSGlobals.strDatabaseName));
 
                         using (log4net.NDC.Push(string.Format("SQL Statment={0}", string.Format("SELECT value from {0}..AppInfo where property='version'", ATSGlobals.strDatabaseName))))

 

  ViewVC Help
Powered by ViewVC 1.1.22