/[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/15 09:15:41	148
+++ trunk/TSAdminTool/Database.cs	2012/07/15 11:21:36	149
@@ -29,7 +29,7 @@
         //private SqlCommand sqlCmd = new SqlCommand();
 
         const string SQL_BROWSER_SERVICE_NAME = "SQLBrowser";
-        public static string InstanceName { get { return AnywhereTS.DBSupport.Properties.Settings.Default.DBInstance; } }
+        //public static string InstanceName { get { return ProSupport.strDatabaseInstance; } }
         public bool SetupDatabase()
         {
             Exception ErrorInfo = null;
@@ -580,7 +580,7 @@
             {
                 prot.Get();
                 if ((string)prot.GetPropertyValue("ProtocolName") == "Np" &&  //Named pipes
-                    (string)prot.GetPropertyValue("InstanceName") == InstanceName)
+                    (string)prot.GetPropertyValue("InstanceName") == ProSupport.strDatabaseInstance)
                 {   // We found the named pipes protocol
                     if (!(bool)prot.GetPropertyValue("Enabled"))
                     {   // Named pipes not activated
@@ -588,7 +588,7 @@
 
                         // Check if user wants to restart SQL server
                         DialogResult resultRights;
-                        resultRights = MessageBox.Show(string.Format("In order for users to use the AnywhereTS control panel, the {0} service on this computer need to be restarted. This operation might take up to 60 seconds. Do you want restart the {0} service now?", InstanceName), string.Format("AnywhereTS - Restart {0} (This operation might take up to 60 seconds!)", InstanceName), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
+                        resultRights = MessageBox.Show(string.Format("In order for users to use the AnywhereTS control panel, the {0} service on this computer need to be restarted. This operation might take up to 60 seconds. Do you want restart the {0} service now?", ProSupport.strDatabaseInstance), string.Format("AnywhereTS - Restart {0} (This operation might take up to 60 seconds!)", ProSupport.strDatabaseInstance), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                         if (resultRights == DialogResult.Yes)
                         {
                             // Restart the SQL server
@@ -597,7 +597,7 @@
                             foreach (ManagementObject svc in sqlServicesMan.GetInstances())
                             {
                                 if ((uint)svc.GetPropertyValue("SqlServiceType") == sqlServerService &&
-                                    (string)svc.GetPropertyValue("ServiceName") == string.Format("MSSQL${0}", InstanceName))
+                                    (string)svc.GetPropertyValue("ServiceName") == string.Format("MSSQL${0}", ProSupport.strDatabaseInstance))
                                 {
                                     svc.Get();
                                     if ((uint)svc.GetPropertyValue("State") != sqlServiceStopped)

 

  ViewVC Help
Powered by ViewVC 1.1.22