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

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

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

revision 133 by william, Sun Jul 15 05:00:59 2012 UTC revision 154 by william, Sun Jul 15 13:27:58 2012 UTC
# Line 51  namespace AnywhereTS.DBSupport Line 51  namespace AnywhereTS.DBSupport
51              }              }
52          }          }
53    
54          public static string GetConnectionString()          public static string GetConnectionString(string server, string instance, string database)
55          {          {
56              return string.Format(@"Data Source={0}\{1};Database={2};Integrated Security=SSPI", DBServerAddress, DBServerInstance, DBDatabase);              return string.Format(@"Data Source={0}\{1};Database={2};Integrated Security=SSPI", server, instance, database);
57          }          }
58          protected DBConnection connection;          protected DBConnection connection;
59          #region DBServerAddress, DBServerInstance, DBDatabase          #region DBServerAddress, DBServerInstance, DBDatabase
# Line 120  namespace AnywhereTS.DBSupport Line 120  namespace AnywhereTS.DBSupport
120              {              {
121                  if (!this.ConnectionIsCreated)                  if (!this.ConnectionIsCreated)
122                  {                  {
123                      connetionString = GetConnectionString();                      connetionString = GetConnectionString(DBServerAddress, DBServerInstance, DBDatabase);
124                      using (log4net.NDC.Push(string.Format("connetionString={0}", connetionString)))                      using (log4net.NDC.Push(string.Format("connetionString={0}", connetionString)))
125                      {                      {
126                          Logging.DatabaseLog.Debug("Creating Connection");                          Logging.DatabaseLog.Debug("Creating Connection");
# Line 166  namespace AnywhereTS.DBSupport Line 166  namespace AnywhereTS.DBSupport
166                      this.CloseConnection(out ErrorInfo);                      this.CloseConnection(out ErrorInfo);
167                  if (!this.ConnectionIsCreated)                  if (!this.ConnectionIsCreated)
168                      this.CreateConnection(out ErrorInfo);                      this.CreateConnection(out ErrorInfo);
169                  connetionString = GetConnectionString();                  connetionString = GetConnectionString(DBServerAddress, DBServerInstance, DBDatabase);
170                  using (log4net.NDC.Push(string.Format("connectionString={0}", connetionString)))                  using (log4net.NDC.Push(string.Format("connectionString={0}", connetionString)))
171                  {                  {
172                      Logging.DatabaseLog.Debug("Opening Connection");                      Logging.DatabaseLog.Debug("Opening Connection");

Legend:
Removed from v.133  
changed lines
  Added in v.154

  ViewVC Help
Powered by ViewVC 1.1.22