Example #1
0
 private void RefreshConnectionString()
 {
     if (ConnectionString != null)
     {
         ConnectionString = DatabaseAssistant.GetDatabaseAssistant(ConnectionType).RefreshConnectionString(ConnectionString);
     }
 }
Example #2
0
 public IDbTransaction GetDbTransaction()
 {
     if (transaction == null)
     {
         var databaseAssistant = DatabaseAssistant.GetDatabaseAssistant(connectionType);
         Log(string.Format("Opening connection <{0}>", connectionString));
         IDbConnection connection = databaseAssistant.CreateConnection(connectionString);
         connection.Open();
         Log("Opened connection. Beginning transaction...");
         transaction = connection.BeginTransaction(isolationLevel);
         Log("Begun transaction.");
     }
     return(transaction);
 }
Example #3
0
        private void connectionStringProperty_ValueChanged(object sender, EventArgs e)
        {
            if (ConnectionString != null)
            {
                DesignTimeConnectionString = ConnectionString;
            }
            else if (ResolvedConnectionString != null)
            {
                DesignTimeConnectionString = string.Empty;
            }

            string resolvedConnectionString = ResolvedConnectionString;

            if (resolvedConnectionString != null)
            {
                ConnectionType?detectedConnectionType = DatabaseAssistant.DetectConnectionType(resolvedConnectionString);
                if ((detectedConnectionType.HasValue) && (detectedConnectionType.Value != ConnectionType))
                {
                    ConnectionType = detectedConnectionType.Value;
                }
            }
        }