using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; namespace AnywhereTS.DBSupport { public class MsSqlConnector : DBConnector { 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(), out ErrorInfo); command.ExecuteNonQuery(); } } return true; } catch (Exception ex) { ErrorInfo = ex; return false; } } } }