ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/AnywhereTS.DBSupport/DBConnector.cs
(Generate patch)

Comparing trunk/AnywhereTS.DBSupport/DBConnector.cs (file contents):
Revision 122 by william, Sat Jul 14 09:40:33 2012 UTC vs.
Revision 123 by william, Sat Jul 14 11:14:09 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines