/[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

--- trunk/AnywhereTS.DBSupport/SqlMdfConnector.cs	2012/07/15 02:55:20	131
+++ trunk/AnywhereTS.DBSupport/SqlMdfConnector.cs	2012/07/15 05:00:59	133
@@ -10,16 +10,19 @@
     {        
         public SqlMdfConnector(string DBServerAddress, string DBServerInstance, string SqlMdf) : base(DBServerAddress, DBServerInstance, SqlMdf) { }
 
-        public override SqlConnection CreateConnection(out Exception ErrorInfo)
+        public override void CreateConnection(out Exception ErrorInfo)
         {
             ErrorInfo = null;
             try
             {
-                string connetionString = null;
-                connetionString = GetConnectionString();
-                connection = new SqlConnection();
-                connection.ConnectionString = connetionString;
-                return connection;
+                string connetionString = GetConnectionString();
+                using (log4net.NDC.Push(string.Format("connetionString={0}", connetionString)))
+                {
+                    Logging.DatabaseLog.Debug("Creating Connection");
+                    connection = new SqlConnection();
+                    connection.ConnectionString = connetionString;
+                    Logging.DatabaseLog.Debug("Created Connection");
+                }
             }
             //catch (SqlException ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex;  throw ErrorInfo;}
             catch (Exception ex) { Console.WriteLine(ex.ToString()); ErrorInfo = ex; throw ErrorInfo; }

 

  ViewVC Help
Powered by ViewVC 1.1.22