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

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

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

revision 121 by william, Sat Jul 14 09:40:33 2012 UTC revision 123 by william, Sat Jul 14 11:14:09 2012 UTC
# Line 5  using System.Data.SqlClient; Line 5  using System.Data.SqlClient;
5  using System.Data.Common;  using System.Data.Common;
6  using System.Data;  using System.Data;
7  using System.Text.RegularExpressions;  using System.Text.RegularExpressions;
8    using System.IO;
9    
10    
11  namespace AnywhereTS.DBSupport  namespace AnywhereTS.DBSupport
12  {  {
# Line 299  namespace AnywhereTS.DBSupport Line 301  namespace AnywhereTS.DBSupport
301          }          }
302          #endregion          #endregion
303          #region public string[] ParseScriptToCommands(string strScript)          #region public string[] ParseScriptToCommands(string strScript)
304          public string[] ParseScriptToCommands(string strScript)      
305          {          protected abstract bool ClientRunScript(string strFile, out Exception ErrorInfo);
             string[] commands;  
             commands = strScript.Split(new string[] { string.Format("GO{0}", System.Environment.NewLine) }, StringSplitOptions.RemoveEmptyEntries);  
             return commands;  
         }  
306          #endregion          #endregion
307          #region public virtual bool RunScript(string strFile, out Exception ErrorInfo)          #region public virtual bool RunScript(string strFile, out Exception ErrorInfo)
308          public bool RunScript(string strFile, out Exception ErrorInfo)          public bool RunScript(string strFile, out Exception ErrorInfo)
# Line 312  namespace AnywhereTS.DBSupport Line 310  namespace AnywhereTS.DBSupport
310              ErrorInfo = null;              ErrorInfo = null;
311              try              try
312              {              {
                 string[] strCommands;  
                 strCommands = ParseScriptToCommands(strFile);  
313                  if (this.ConnectionIsOpen)                  if (this.ConnectionIsOpen)
314                  {                  {
315                      if (!ClientRunScript(strCommands, out ErrorInfo))                      if (!ClientRunScript(strFile, out ErrorInfo))
316                      {                      {
317                          return false;                          return false;
318                      }                      }
# Line 345  namespace AnywhereTS.DBSupport Line 341  namespace AnywhereTS.DBSupport
341              }              }
342              return false;              return false;
343          }          }
         public abstract bool ClientRunScript(string[] strCommands, out Exception ErrorInfo);  
344          #endregion          #endregion
345          #endregion          #endregion
346    

Legend:
Removed from v.121  
changed lines
  Added in v.123

  ViewVC Help
Powered by ViewVC 1.1.22