Programmatic Parameter Inputs
Inputs can also be specified programmatically. This is achieved by accessing the method object by name, and then setting the value on the input, specified by either the name or the index.
Setting input by name:
C#: Method1.Inputs["S95Id"].Value = "enterprise123";
VB: Method1.Inputs("S95Id").Value = "enterprise123"
Setting input by index (C#). When specifying input by index, it is zero based. However, use caution with this mechanism because the index does not necessarily match the order in which the parameters are shown in the Properties panel. Therefore, this mechanism is useful only when there is one parameter.
C#: Method1.Inputs[0].Value = "enterprise123";
VB: Method1.Inputs(0).Value = "enterprise123"
Parameters can also be iterated over in the following manner:
C#:
foreach (var parameter in Method1.Inputs)
{
String parameterName = parameter.ParameterName;
Object value = parameter.Value;
}
VB:
Dim parameterName As String
Dim value As Object
For Each parameter in SampleMethod.Inputs
parameterName = parameter.ParameterName
value = parameter.Value
Next