/[AnywhereTS-MSSQL]/trunk/AnywhereTS.DBSupport/MSSQLConnector.cs
ViewVC logotype

Diff of /trunk/AnywhereTS.DBSupport/MSSQLConnector.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/AnywhereTS.DBSupport/MSSQLConnector.cs	2012/07/13 21:10:26	85
+++ trunk/AnywhereTS.DBSupport/MSSQLConnector.cs	2012/07/14 09:08:55	119
@@ -8,5 +8,29 @@
     public class MsSqlConnector : DBConnector<SqlParameter,SqlCommand,SqlConnection,SqlDataAdapter>
     {
         public MsSqlConnector(string DBServerAddress, string DBServerInstance, string DBDatabase) : base(DBServerAddress, DBServerInstance, DBDatabase) { }
+
+        public override bool ClientRunScript(string[] strCommands, out Exception ErrorInfo)
+        {
+            ErrorInfo = null;
+            try
+            {
+                foreach (string strCmd in strCommands)
+                {
+                    if (strCmd.Length > 0)
+                    {
+                        Logging.DatabaseLog.DebugFormat("Current Command: {0}{1}",System.Environment.NewLine, strCmd);
+                        // Substitute database directory with the decided one.
+                        SqlCommand command = this.CreateCommandInstance(strCmd, new List<SqlParameter>(), out ErrorInfo);
+                        command.ExecuteNonQuery();
+                    }
+                }
+                return true;
+            }
+            catch (Exception ex)
+            {
+                ErrorInfo = ex;
+                return false;
+            }
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22