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

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

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

revision 89 by william, Fri Jul 13 22:56:50 2012 UTC revision 123 by william, Sat Jul 14 11:14:09 2012 UTC
# Line 2  Line 2 
2  using System.Collections.Generic;  using System.Collections.Generic;
3  using System.Text;  using System.Text;
4  using System.Data.SqlClient;  using System.Data.SqlClient;
5    using Microsoft.SqlServer.Management.Common;
6    using Microsoft.SqlServer.Management.Smo;
7    
8  namespace AnywhereTS.DBSupport  namespace AnywhereTS.DBSupport
9  {  {
# Line 25  namespace AnywhereTS.DBSupport Line 27  namespace AnywhereTS.DBSupport
27    
28          new public static string GetConnectionString()          new public static string GetConnectionString()
29          {          {
30              return string.Format(@"Data Source={0}\{1};;AttachDbFilename=|DataDirectory|\{2};Integrated Security=SSPI", DBServerAddress, DBServerInstance, DBDatabase);              return string.Format(@"Data Source={0}\{1};AttachDbFilename=|DataDirectory|\{2};Integrated Security=SSPI", DBServerAddress, DBServerInstance, DBDatabase);
31            }
32    
33            protected override bool ClientRunScript(string strFile, out Exception ErrorInfo)
34            {
35                ErrorInfo = null;
36                try
37                {
38                    Server server = new Server(new ServerConnection(this.connection));
39                    server.ConnectionContext.ExecuteNonQuery(strFile);
40                    return true;
41                }
42                catch (Exception ex)
43                {
44                    ErrorInfo = ex;
45                    return false;
46                }
47          }          }
48      }      }
49  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.22