Last post Mar 25, 2014 05:09 AM by gtscdsi
Mar 24, 2014 05:49 AM|thanjaipvr|LINK
I would like to pass Object(instance of custom class) as parameter to a Method Which is invoked by TPL TASK.
clsRDL objRDL = new clsRDL();
RDLReportDetails rdlReportDetails = new CLsRDLGeneratePDFReportDetails("/Report1",strOutputFileName,strUserName,strpwd,strDomainName);
Task.Factory.StartNew(() => objRDL.GenerateReport(rdlReportDetails);
But it show error message in parameter "member cannot be accessed with an instance reference qualify it with a type name instead"
could you guide me on this
Thanks and Regards
Mar 25, 2014 05:09 AM|gtscdsi|LINK
The exception "member cannot be accessed with an instance reference qualify it with a type name instead" is usually thrown out while a static member being passed as the parameter.
You can reference the following articles for more detailes:
C# member cannot be accessed with an instance reference