c# - SSIS Web Service Script Component (The given key was not present in the dictionary) -


i'm sorry if question has been answered already, i've done research , have yet find makes sense.

i'm creating ssis script component connects web service , dump data sql table. though script component still work in progress following error: @ system.collections.generic.dictionary`2.get_item(tkey key) @ scriptmain.createnewoutputrows() @ usercomponent.primeoutput(int32 outputs, int32[] outputids, pipelinebuffer[] buffers, outputnamemap outputmap) @ microsoft.sqlserver.dts.pipeline.scriptcomponenthost.primeoutput(int32 outputs, int32[] outputids, pipelinebuffer[] buffers)

here's core of code i'm using script component:

  public dictionary<string, int> agentstatisticscolumns = new dictionary<string, int>();  public override void createnewoutputrows() {      //setsessionparameters sessionparams = new setsessionparameters();     //sessionparams.viewsettings = new viewsettings     //{     //    apptype = "custom",     //    forcelogoutsession = false,     //    idletimeout = 600,     //    rollingperiod = rollingperiod.minutes5,     //    shiftstart = 28800000,     //    statisticsrange = statisticsrange.currentday,     //    timezone = -25200000     //};           getstatistics statistics = new getstatistics();          statistics.statistictypespecified = true;         statistics.statistictype = statistictype.agentstatistics;         statistics.columnnames = null;          getstatisticsresponse resp = new getstatisticsresponse();          statistics statistics_return = resp.@return;          int usernameidx = agentstatisticscolumns["username"];          foreach (row r in statistics_return.rows)         {             output0buffer.username = r.values[usernameidx];             //string log = r.values[usernameidx];              //output0buffer.username = log;         }  } 

any appreciated!

you absolutely right, , that's dumb oversight part. need incorporate field: public static wssupervisorservice supervisorservice = null;

with i'm able wrap getstatisticsresponse resp = supervisorservice.getstatistics(statistics); actual value.

thanks nick!

 public dictionary<string, int> agentstatisticscolumns = new dictionary<string, int>();     public static wssupervisorservice supervisorservice = null;     public static void main(string[] args)     {         supervisorservice = new wssupervisorservice();         setsessionparameters sessionparams = new setsessionparameters();          sessionparams.viewsettings = new viewsettings         {             apptype = "custom",             forcelogoutsession = false,             idletimeout = 600,             rollingperiod = rollingperiod.minutes5,             shiftstart = 28800000,             statisticsrange = statisticsrange.currentday,             timezone = -25200000         };          getstatistics statistics = new getstatistics();         statistics.statistictypespecified = true;         statistics.statistictype = statistictype.agentstatistics;         statistics.columnnames = null;          try         {             getstatisticsresponse resp = supervisorservice.getstatistics(statistics);         }         catch (exception)         {              throw;         }     } 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -