Touchstone 11.0 API Reference
SubmitDowngradeDatabases Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > DataSourceManagementServiceClient Class : SubmitDowngradeDatabases Method
Contains a SubmitDowngradeDatabasesRequest that identifies the eligible Databases Information that you want to downgrade, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.
Downgrades an existing Touchstone Exposure Database to a previous version.

You can downgrade a database from one release of Touchstone to the previous major release of Touchstone. For example, you can upgrade a Touchstone 11.x database to Touchstone 10.x.

To view the current version of your Touchstone client, use the GetSecurityPolicy() method.

Syntax
Public Function SubmitDowngradeDatabases( _
   ByVal request As SubmitDowngradeDatabasesRequest _
) As SubmitDowngradeDatabasesResponse
Dim instance As DataSourceManagementServiceClient
Dim request As SubmitDowngradeDatabasesRequest
Dim value As SubmitDowngradeDatabasesResponse
 
value = instance.SubmitDowngradeDatabases(request)

Parameters

request
Contains a SubmitDowngradeDatabasesRequest that identifies the eligible Databases Information that you want to downgrade, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.

Return Value

A SubmitDowngradeDatabasesResponse containing the Activity SID that uniquely identifies the asynchronous web service call that you made to upgrade the specified Database.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

To downgrade a Database, perform the following steps:

  1. Get the Database you want to downgrade by calling the GetDatabases() method.
  2. Specify the desired Database object from the previous step and add as the DowngradableDatabaseInfo part of a DowngradeDatabaseInfo object for the SubmitDowngradeDatabases() method.
  3. In DowngradedDatabaseInfo, add another Database object with the name and file paths where you want to store the downgraded version of the database.
  4. Add the DowngradeDatabaseInfo object created in steps 2 and 3 to the DowngradeDatabasesInfo list in the SubmitDowngradeDatabasesRequest object for the SubmitDowngradeDatabases() method.
  5. Submit your request.
Example
using AIR.Services.Common.Data;
using AIR.Services.DataSourceManagement.Api;
using AIR.Services.DataSourceManagement.Data;
using System;
using System.Linq;
class SnippetSubmitDowngradeDatabasesRequest
{
private static void SubmitDowngradeDatabases(int businessUnitSid, int sqlInstanceSid, string dbServerName, string dbName)
{
DataSourceManagementServiceClient dsClient = new DataSourceManagementServiceClient();
GetDatabasesRequest request = new GetDatabasesRequest();
request.BusinessUnitSid = businessUnitSid;
request.SqlInstanceSid = sqlInstanceSid;
request.DataServerName = dbServerName;
GetDatabasesResponse response = dsClient.GetDatabases(request);
    if (response.Status.Code == StatusCode.Success)
   {
//Find the data source object
Database db = response.Databases.FirstOrDefault(d => d.Name == dbName);
        if (db == null)
       {
         Console.WriteLine("Database not found");
         return;
}
SubmitDowngradeDatabasesRequest dsRequest = new SubmitDowngradeDatabasesRequest();
dsRequest.BusinessUnitSid = businessUnitSid;
dsRequest.SqlInstanceSid = sqlInstanceSid;
dsRequest.DowngradeDatabasesInfo = new System.Collections.Generic.Listlt;DowngradeDatabaseInfogt;() {
new DowngradeDatabaseInfo()
                {
DowngradeableDatabase = db,
DowngradedDatabase = new Database()
                  {
Name= "test_downgraded_exp",
MdfFilePath = @"E:\test_downgraded_exp.mdf"
}
}
};
            
SubmitDowngradeDatabasesResponse dsResponse = dsClient.SubmitDowngradeDatabases(dsRequest);
             
       if (dsResponse.Status.Code == StatusCode.Success)
Console.WriteLine("Submitted Successfully to HPC with Activity ID: " + dsResponse.ActivitySid);
}
}
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DataSourceManagementServiceClient Class
DataSourceManagementServiceClient Members