/[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/11 20:13:17	22
+++ trunk/TSAdminTool/Database.cs	2012/07/12 10:52:05	33
@@ -6,11 +6,13 @@
 using System.Windows.Forms;
 using System.Text.RegularExpressions;
 using System.Management;
+using log4net;
 
 namespace AnywhereTS
 {
     class DatabaseSupport
     {
+        private readonly ILog logger = LogManager.GetLogger("AnywhereTS.ATSAmdinLogger"); 
         enum VersionCheck
         {
             Failed = 0, 
@@ -47,6 +49,7 @@
         {
             bool bContinue = false;
             // Create a connection to SQL Server
+            logger.Debug("SetupDatabase() called ");
             try
             {
                 sqlCon.ConnectionString = Properties.Settings.Default.atsConnectionString;
@@ -59,15 +62,6 @@
                 //bCreateDB = true;
                 try
                 {
-                    try
-                    {
-                        sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString);
-                        sqlCon.Open();
-                        RunScript("DROP AnywhereTS");
-                        sqlCon.Close();
-                    }
-                    catch { }
-
                     sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString.Replace("AnywhereTS", "master"));
                     sqlCon.Open();
                     RunScript(Resource1.CreateDatabase.ToString());
@@ -76,8 +70,8 @@
                     sqlCon.Open();
                     RunScript(Resource1.CreateTables.ToString());
                     sqlCon.Close();
-                    sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString);
-                    sqlCon.Open();
+                    //sqlCon = new SqlConnection(Properties.Settings.Default.atsConnectionString);
+                    //sqlCon.Open();
                 }
                 catch (SqlException sql_ex1)
                 {

 

  ViewVC Help
Powered by ViewVC 1.1.22