ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/AnywhereTS.DBSupport/DBConnector.cs
(Generate patch)

Comparing trunk/AnywhereTS.DBSupport/DBConnector.cs (file contents):
Revision 120 by william, Sat Jul 14 09:08:55 2012 UTC vs.
Revision 121 by william, Sat Jul 14 09:40:33 2012 UTC

# Line 97 | Line 97 | namespace AnywhereTS.DBSupport
97          public virtual void CreateConnection(out Exception ErrorInfo)
98          {
99              ErrorInfo = null;
100 +            string connetionString = string.Empty;
101              try
102 <            {
102 <                string connetionString = null;
102 >            {                
103                  connetionString = GetConnectionString();
104 <                connection = new DBConnection();
105 <                connection.ConnectionString = connetionString;
104 >                using (log4net.NDC.Push(string.Format("connetionString={0}", connetionString)))
105 >                {
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)
113              {
# Line 126 | Line 131 | namespace AnywhereTS.DBSupport
131          public virtual void OpenConnection(out Exception ErrorInfo)
132          {
133              ErrorInfo = null;
134 +            string connetionString = string.Empty;
135              try
136              {
137                  //this.CloseConnection(out ErrorInfo);
138 <                connection.Open();
139 <                this.ConnectionIsOpen = true;
138 >                connetionString = GetConnectionString();
139 >                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;}
148              catch (SqlException ex)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines