I am facing an issue while trying to open editor for custom control flow component. I tried to copied the dll where package resides but didn't help. Please do let me know if I am doing anything wrong or how to fix this issue.
Here is the code:
Main class inherits TASK
namespace SSIS.Custom.ControlFlowUI
{
[DtsTask (
DisplayName = "CopyTable",
Description = "A custom Unzip task for demonstration purposes.",
TaskType = "CustomComponent",
UITypeName = "CopyTableTaskUI, CopyTable, Version=1.0.0.0,Culture=Neutral, PublicKeyToken=9097a336d1055e0b")]
public class CopyTable : Task
{
#region Override methods
public override DTSExecResult Validate(Connections connections,
VariableDispenser variableDispenser, IDTSComponentEvents componentEvents,
IDTSLogging log)
{
return base.Validate(connections, variableDispenser, componentEvents, log);
}
public override DTSExecResult Execute(Connections connections, VariableDispenser variableDispenser, IDTSComponentEvents componentEvents, IDTSLogging log, object transaction)
{
try
{
ValidateSchema(@"GGN19\MSSQL12");
// Return success.
return DTSExecResult.Success;
}
catch (System.Exception exception)
{
// Capture exceptions, post an error, and fail validation.
return DTSExecResult.Failure;
}
}
#endregion
#region Public methods
public string ValidateSchema(string tableName)
{
GetTableList(tableName);
return "";
}
private List<string> GetTableList(string ServerName)
{
List<string> lTables = new List<string>();
try
{
SqlConnection dbConn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TestingTmp;Data Source=" + ServerName);
SqlCommand dbCmd = new SqlCommand("Select NAME from sysobjects where type ='U';", dbConn);
dbConn.Open();
SqlDataReader SqlDR = dbCmd.ExecuteReader();
while (SqlDR.Read())
{
lTables.Add(SqlDR.GetString(0));
}
dbConn.Close();
}
catch (Exception ex) { }
return lTables;
}
private bool ValidateTableSchema(string ServerName, string table1, string table2)
{
SqlConnection dbConn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=msdb;Data Source=" + ServerName);
SqlCommand dbCmd = new SqlCommand("Select * from '" + table1 + "';", dbConn);
dbConn.Open();
SqlDataReader SqlDR = dbCmd.ExecuteReader();
DataTable schema = SqlDR.GetSchemaTable();
dbCmd = new SqlCommand("Select * from '" + table2+ "';", dbConn);
dbConn.Open();
SqlDR = dbCmd.ExecuteReader();
DataTable schema2 = SqlDR.GetSchemaTable();
return schema.Equals(schema2);
}
#endregion
}
UI Class
namespace ControlFlowUI
{
public class CopyTableTaskUI : IDtsTaskUI
{
#region // Fields
private TaskHost _taskHost;
#endregion
#region Properties
#endregion
#region Methods
public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider)
{
_taskHost = taskHost;
}
public ContainerControl GetView()
{
return new CopyTableFrm(_taskHost);
}
#endregion
#region IDtsTaskUI Members
public void Delete(IWin32Window parentWindow)
{
throw new NotImplementedException();
}
public void New(IWin32Window parentWindow)
{
throw new NotImplementedException();
}
#endregion
}
}
Error is related the user interface which is been attached to custom control flow, its basically you can create 2 types of control flow components one is simple transformation and another you can also have some UI to get user input, ssis will allows you to double click on the component and provide the values...so when I double click on the com to get UI its throws error.. TITLE: Microsoft Visual Cannot show the editor for this task. The task user interface specified by type name 'CopyTableTaskUI, CopyTable, Version=1.0.0.0,Culture=Neutral, PublicKeyToken=9097a336d1055e0b' could not be loaded. Could not load file or assembly 'CopyTable, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9097a336d1055e0b' or one of its dependencies. The