예제 #1
0
파일: DbView.cs 프로젝트: pontusm/Deployer
        /// <summary>
        /// Deploys the database object.
        /// </summary>
        public void Deploy(DatabaseInfo sourceDbService, DatabaseInfo destinationDbService)
        {
            // Retrieve source code
            string src = sourceDbService.GetViewSourceCode(_viewname);

            if(!_isnew)
                src = src.Replace("CREATE VIEW", "ALTER VIEW");

            // Deploy it
            destinationDbService.ExecuteNonQuery(src);
        }
예제 #2
0
 /// <summary>
 /// Initializes source and destination web services and starts the sessions.
 /// </summary>
 private void InitializeServices(DatabasePair databases)
 {
     // Setup web service connections
     _sourceDbService = InitializeService(databases.Source);
     _destinationDbService = InitializeService(databases.Destination);
 }
예제 #3
0
 /// <summary>
 /// Initializes the web service and starts a new session.
 /// </summary>
 /// <param name="database"></param>
 private DatabaseInfo InitializeService(DatabaseDescriptor database)
 {
     try {
         DatabaseInfo service = new DatabaseInfo();
         service.CookieContainer = new CookieContainer();
         service.Url = database.Url;
         service.StartSession(_clienttoken, database.Name);
         return service;
     }
     catch (WebException ex) {
         throw new ApplicationException(string.Format("Unable to connect to database info service (Name={0}, Url={1})", database.Name, database.Url), ex);
     }
 }