/// <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); }
/// <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); }
/// <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); } }