c# SSIS - Object reference not set to an instance of an object -


enter image description herei working on ssis package (this new me). using script component source, using readonlyvariable (varpackagepath) , assigned value 'c:\development\ssisprojects\vs2012\geterrorcolumn\geterrorcolumn\package.dtsx' location of project. script used relavent column error occured. link following : http://www.techbrothersit.com/2013/12/ssis-how-to-get-error-column-name-in.html

i have debugged c# code , getting error @ line :

taskname = executablenode.selectsinglenode("dts:property[@dts:name='objectname']", namespcmgr).innertext; 

error : 'object reference not set instance of object'.

my c# code :

 public override void createnewoutputrows() {     /*       add rows calling addrow method on member variable named "<output name>buffer".       example, call myoutputbuffer.addrow() if output named "myoutput".     */     //declare variables     string taskname;     string colname;     int32 collineageid;     string colkey;      //read package file     xmldocument packagefile = new xmldocument();     packagefile.load(variables.varpackagepath);      //create hash table      hashtable colkeytable = new hashtable();       xmlnamespacemanager namespcmgr = new xmlnamespacemanager(packagefile.nametable);     namespcmgr.addnamespace("dts", "www.microsoft.com/sqlserver/dts");      foreach (xmlnode childnode in packagefile.selectnodes("//*[@lineageid != '' , @name != '']"))     {           xmlnode executablenode = childnode.selectsinglenode("ancestor::dts:executable[1]", namespcmgr);         taskname = executablenode.selectsinglenode("dts:property[@dts:name='objectname']", namespcmgr).innertext;         colname = childnode.attributes["name"].value;         collineageid = convert.toint32(childnode.attributes["lineageid"].value);         colkey = taskname + colname + collineageid;         if (!colkeytable.containskey(colkey))         {             colkeytable.add(colkey, dbnull.value);              output0buffer.addrow();             output0buffer.collineageid = collineageid;             output0buffer.colname = colname;             output0buffer.taskname = taskname;         }     } } 

any help/suggestion please.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -