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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 119 - (hide annotations) (download)
Sat Jul 14 09:08:55 2012 UTC (8 years, 10 months ago) by william
File size: 1327 byte(s)
+ bulk commit again

1 william 85 using System;
2     using System.Collections.Generic;
3     using System.Text;
4     using System.Data.SqlClient;
5    
6     namespace AnywhereTS.DBSupport
7     {
8     public class MsSqlConnector : DBConnector<SqlParameter,SqlCommand,SqlConnection,SqlDataAdapter>
9     {
10     public MsSqlConnector(string DBServerAddress, string DBServerInstance, string DBDatabase) : base(DBServerAddress, DBServerInstance, DBDatabase) { }
11 william 119
12     public override bool ClientRunScript(string[] strCommands, out Exception ErrorInfo)
13     {
14     ErrorInfo = null;
15     try
16     {
17     foreach (string strCmd in strCommands)
18     {
19     if (strCmd.Length > 0)
20     {
21     Logging.DatabaseLog.DebugFormat("Current Command: {0}{1}",System.Environment.NewLine, strCmd);
22     // Substitute database directory with the decided one.
23     SqlCommand command = this.CreateCommandInstance(strCmd, new List<SqlParameter>(), out ErrorInfo);
24     command.ExecuteNonQuery();
25     }
26     }
27     return true;
28     }
29     catch (Exception ex)
30     {
31     ErrorInfo = ex;
32     return false;
33     }
34     }
35 william 85 }
36     }

  ViewVC Help
Powered by ViewVC 1.1.22