Method SetParameters
SetParameters(int[], object[], DateTime[])
Sets the parameters with the specified IDs to the specified values.
object SetParameters(int[] ids, object[] values, DateTime[] timeInfos)
Parameters
ids
int[]The IDs of the parameters to set.
values
object[]The values to set.
timeInfos
DateTime[]Timestamps.
Returns
- object
Either a single HRESULT (uint) value specifying an error (e.g. when the size of the parameterIDs array does not match the size of the values array) or an array of HRESULT values (uint[]) (where the array has the same size as the number of parameters that have been set) where each HRESULT value indicates the result of the corresponding item that has been set.
Examples
DateTime timeStamp = DateTime.Now;
protocol.SetParameters(new int[] { 31, 32 }, new object[] { "value A", "value B" }, new DateTime[]{ timeStamp, timeStamp });
Remarks
- Feature introduced in DataMiner version 8.0.3.
- From DataMiner 10.2.9 onwards (RN 33849), if the DateTime.Kind property of an entry in
timeInfos
is unspecified, the timestamp entry will be handled as local time. - A null value will not clear the parameter but keep its current value. To clear a parameter, see clear.
SetParameters(int[], object[])
Sets the parameters with the specified IDs to the specified values.
object SetParameters(int[] ids, object[] values)
Parameters
Returns
- object
Either a single HRESULT (uint) value specifying an error (e.g. when the size of the parameterIDs array does not match the size of the values array) or an array of HRESULT values (uint[]) (where the array has the same size as the number of parameters that have been set) where each HRESULT value indicates the result of the corresponding item that has been set.
Examples
protocol.SetParameters(new int[] { 31, 32 }, new object[] { "value A", "value B" });
In order to avoid magic numbers, you can make use of the Parameter class.
protocol.SetParameters(new int[] { Parameter.myparameter, Parameter.myparameter2 }, new object[] { "value A", "value B" });