How to convert String to Datarow type

Hello,

Can some suggest me how to convert the string (“2018”) to data row type .

thankyou in advance!!!

@Apchu
it depends on your datacolumn structure

give a try on following:
yourNewDataRow = YourdataTableVar.NewRow
yourNewDataRow (YourCoNameOrIndex) = “2018”

Thankyou for reply…

Let me explain you in detail

I am reading excel and from that output data table I am fetching the data of once column (date occured : column name) using for each row.
The data is something like this (21/21/2020) I need only the year so I am splitting it and taking only the year part.

next I need to write that year in other column

so this is the scenario

a far we did understand you want to update another column from same row which is used for the year split, right?

For each row activity# row | yourDataTablevar

  • assign activity: strYear = Split done with row(“date occured”)
  • assign activity: row(ColNameOrIndex) = strYear

for better understanding I have a screenshot for you…