/[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 123 - (hide annotations) (download)
Sat Jul 14 11:14:09 2012 UTC (9 years, 3 months ago) by william
File size: 1008 byte(s)
+ bulk commit
-- add SQLSerer SMO support for executing TSQL commands

1 william 85 using System;
2     using System.Collections.Generic;
3     using System.Text;
4     using System.Data.SqlClient;
5 william 123 using Microsoft.SqlServer.Management.Common;
6     using Microsoft.SqlServer.Management.Smo;
7 william 85
8     namespace AnywhereTS.DBSupport
9     {
10     public class MsSqlConnector : DBConnector<SqlParameter,SqlCommand,SqlConnection,SqlDataAdapter>
11     {
12     public MsSqlConnector(string DBServerAddress, string DBServerInstance, string DBDatabase) : base(DBServerAddress, DBServerInstance, DBDatabase) { }
13 william 119
14 william 123
15     protected override bool ClientRunScript(string strFile, out Exception ErrorInfo)
16 william 119 {
17     ErrorInfo = null;
18     try
19     {
20 william 123 Server server = new Server(new ServerConnection(this.connection));
21     server.ConnectionContext.ExecuteNonQuery(strFile);
22 william 119 return true;
23     }
24     catch (Exception ex)
25     {
26     ErrorInfo = ex;
27     return false;
28     }
29     }
30 william 85 }
31     }

  ViewVC Help
Powered by ViewVC 1.1.22