/[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 11:14:09	123
@@ -2,11 +2,30 @@
 using System.Collections.Generic;
 using System.Text;
 using System.Data.SqlClient;
+using Microsoft.SqlServer.Management.Common;
+using Microsoft.SqlServer.Management.Smo;
 
 namespace AnywhereTS.DBSupport
 {
     public class MsSqlConnector : DBConnector<SqlParameter,SqlCommand,SqlConnection,SqlDataAdapter>
     {
         public MsSqlConnector(string DBServerAddress, string DBServerInstance, string DBDatabase) : base(DBServerAddress, DBServerInstance, DBDatabase) { }
+
+
+        protected override bool ClientRunScript(string strFile, out Exception ErrorInfo)
+        {
+            ErrorInfo = null;
+            try
+            {
+                Server server = new Server(new ServerConnection(this.connection));
+                server.ConnectionContext.ExecuteNonQuery(strFile);
+                return true;
+            }
+            catch (Exception ex)
+            {
+                ErrorInfo = ex;
+                return false;
+            }
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22