ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/AnywhereTS.DBSupport/MSSQLConnector.cs
Revision: 119
Committed: Sat Jul 14 09:08:55 2012 UTC (11 years, 2 months ago) by william
File size: 1327 byte(s)
Log Message:
+ bulk commit again

File Contents

# Content
1 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
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 }
36 }