How to overwrite readonly

Hi I have a column (“Result”) which has got “True” in some of the rows, I am trying to enter “True” on the empty rows (that does not have “True” printed) but unfortunately getting readonly error

I tried using .readonly still its not working. Anyone has any idea
error1


error2

@dipon1112000

Createa new column with similr name then use below in invoke code

Dt.AsSnumerable.ToList.ForEach(Sub(r) r("NewCol") = r("Result").ToString)

This will create a replica of same column without expression which can be edited

The old column can be deleted later

Cheers

hi thank for replying

A. its multiple for each row because that is the condition where after multiplying if the result is true then true needs to be passed to Result (column). This is happening only if I am trying to use the Column “Result” (as there are some rows which has got True printed) and I am trying to fill the remaining rows which are empty. But if I create a new column then there is no issue.

B. I have assigned datatable variable (dt) for my csv so not quite sure if datatable is readonly or not

@dipon1112000

Please create a nee column as mentioned above

As the column might be created using expression it is creating an issue

Cheers

there is no way to handle this?

@dipon1112000

As you would have used expression to write the data in column…you cannot edit normally…so the way would be to create an extra column and copy all data to that as mentioned above and use that instead

Also instead of using. Expression to generate value…you can use the similar way as mentioned above which will not give this exception

Cheers

thanks a lot it worked :pray:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.