I am using SSIS script component to change scale value of a DATETIMESTAMP2 field.
My Input field is DT_DATETIMESTAMP2 ( 6). I want to convert this to DT_DATETIMESTAMP2 ( 6) in my script component.
I will be passing all fields from a table to the script component.
My code should check if the datatype of the field is DATETIMESTAMP2 and then convert to scale-5.
The fields are readwrite types.
I tried the following but it isnt working,
foreach (PropertyInfo p in Row.GetType().GetProperties()){ if (object.ReferenceEquals(p.PropertyType, typeof(DTP_DBTIMESTAMP2)))
{
p.SetValue(Row, Convert.ToDateTime(5));
}
Thanks in Advance