/[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 119 by william, Sat Jul 14 09:08:55 2012 UTC revision 121 by william, Sat Jul 14 09:40:33 2012 UTC
# Line 97  namespace AnywhereTS.DBSupport Line 97  namespace AnywhereTS.DBSupport
97          public virtual void CreateConnection(out Exception ErrorInfo)          public virtual void CreateConnection(out Exception ErrorInfo)
98          {          {
99              ErrorInfo = null;              ErrorInfo = null;
100                string connetionString = string.Empty;
101              try              try
102              {              {                
                 string connetionString = null;  
103                  connetionString = GetConnectionString();                  connetionString = GetConnectionString();
104                  connection = new DBConnection();                  using (log4net.NDC.Push(string.Format("connetionString={0}", connetionString)))
105                  connection.ConnectionString = connetionString;                  {
106                        Logging.DatabaseLog.Debug("Creating Connection");
107                        connection = new DBConnection();
108                        connection.ConnectionString = connetionString;
109                        Logging.DatabaseLog.Debug("Created Connection");
110                    }
111              }              }
112              catch (SqlException ex)              catch (SqlException ex)
113              {              {
# Line 126  namespace AnywhereTS.DBSupport Line 131  namespace AnywhereTS.DBSupport
131          public virtual void OpenConnection(out Exception ErrorInfo)          public virtual void OpenConnection(out Exception ErrorInfo)
132          {          {
133              ErrorInfo = null;              ErrorInfo = null;
134                string connetionString = string.Empty;
135              try              try
136              {              {
137                  //this.CloseConnection(out ErrorInfo);                  //this.CloseConnection(out ErrorInfo);
138                  connection.Open();                  connetionString = GetConnectionString();
139                  this.ConnectionIsOpen = true;                  using (log4net.NDC.Push(string.Format("connectionString={0}", connetionString)))
140                    {
141                        Logging.DatabaseLog.Debug("Opening Connection");
142                        connection.Open();
143                        this.ConnectionIsOpen = true;
144                        Logging.DatabaseLog.Debug("Opened Connection");
145                    }
146              }              }
147              //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}              //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}
148              catch (SqlException ex)              catch (SqlException ex)

Legend:
Removed from v.119  
changed lines
  Added in v.121

  ViewVC Help
Powered by ViewVC 1.1.22