Error while opening editor for custom control flow component in ssis 2012
hi,
i facing issue while trying open editor custom control flow component. i tried copied dll package resides didn't help. please let me know if doing wrong or how fix issue.
here code:
main class inherits task
namespace ssis.custom.controlflowui
{
[dtstask (
displayname = "copytable",
description = "a custom unzip task 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 error, , 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 sysobjects 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 * '" + table1 + "';", dbconn);
dbconn.open();
sqldatareader sqldr = dbcmd.executereader();
datatable schema = sqldr.getschematable();
dbcmd = new sqlcommand("select * '" + table2+ "';", dbconn);
dbconn.open();
sqldr = dbcmd.executereader();
datatable schema2 = sqldr.getschematable();
return schema.equals(schema2);
}
#endregion
}
ui class
namespace mckinsey.solutions.ssis.custom.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
}
}
}
please mark post answered if answers question | ssis blog: http://microsoft-ssis.blogspot.com | twitter
SQL Server > SQL Server Integration Services
Comments
Post a Comment