In one of the packages I am developing I would like to run data through script component and loop through columns whose names contain _CreationID and are not null or blank. I then want to and check that the column values per are the same. However I am struggling to write the vb code in the script editor. I think the process should be
1) loop through columns whose names contain _creationID and are not blank/null
2) load values into an array
3) check if all elements in array are have the same value
4) if the elements have the same value create new output column with value 1
5) if the elements are not matched create new output column with value 0
My code thus far is as follows:
Maybe my strategy is incorrect and there is an easier way. Any ideas would be appreciated.
1) loop through columns whose names contain _creationID and are not blank/null
2) load values into an array
3) check if all elements in array are have the same value
4) if the elements have the same value create new output column with value 1
5) if the elements are not matched create new output column with value 0
My code thus far is as follows:
Code:
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim rowType As Type = Row.GetType()
Dim columnValue As PropertyInfo
Dim previousRow As String
For Each columnValue In Row.GetType().GetProperties()
If (columnValue.Name.EndsWith("_CreationID") And columnValue.GetValue(Row, Nothing).ToString() = "") Then
' How can I access they value of the column and load it into and array?
' How can I check elements in the array are equal?
End If
Next
'
End Sub
End Class
Maybe my strategy is incorrect and there is an easier way. Any ideas would be appreciated.