I am trying to populate a table from an automation script. The developer guide seems to say that it should be possible to use SetParameterByPrimaryKey or SetParameter with the table, keay and row data.
However I always get an invalid data message as below.
Initialisation of a stand alone parameter is fine.
What should be the correct API to use for populating a table from an automation script?
Set Parameter 117601/1803/12300/ failed (Invalid data.: 0x80040221)
(Code: 0x80131500) Skyline.DataMiner.Net.Exceptions.DataMinerException: Set Parameter ('_117601_1803':12300/) Failed: 0x80004005
at CManagedAutomation.RunWrapped(CManagedAutomation* , Int32 iCookie, IUnknown* pIAutomation, tagVARIANT* varParameters, tagVARIANT* pvarReturn, String scriptName)
at CManagedAutomation.Run(CManagedAutomation* , Int32 iCookie, Char* bstrScriptName, IUnknown* pIAutomation,
One way to do so, could be using Engine Extension methods which will allow you to access IDmsTable Methods.
Something in the lines of:
IDms dms = engine.GetDms();
IDmsElement element = dms.GetElement("Element Name");
IDmsTable table = element.GetTable(tableId);
table.SetRow(primaryKey, Object[] data) or table.AddRow(Object[] data);
Hope it helps!
I believe it comes from Skyline.Dataminer.Library.Automation included in the Dataminer System.dll Assembly.
As Jens Gellynck comment I don’t have this extension method.
WIthin the automation script editor I am unable to add the namespace Skyline.DataMiner.Library.Automation
What should the namepace be to access the necessary methods?
Hi,
You will need to include the following:
using Skyline.DataMiner.Library.Automation;
using Skyline.DataMiner.Library.Common;
Hi John and Jens,
Are you trying this directly from the code editor in DataMiner or are you editing the script in Visual Studio?
Because, if I recall correctly, you require Visual Studio and DIS to have access to the methods mentioned as they come from Class Library which is generated from DIS
I don’t have this extension method, does it come from an external library?