Data row field turns read only and restrict update

Have anyone faced this issue where data field turns read only and when we try to update the value, it throws the exception.

Exception has been thrown by the target of an invocation.| System.Data.ReadOnlyException: Column ‘RequestType’ is read only.
at System.Data.DataRow.set_Item(DataColumn column, Object value)
at System.Data.DataRow.set_Item(String columnName, Object value)

Hi @niteshvnr

Can you give us some background on this. How this datarow variable is used and from where it is taken

Hi,

This happens when I do SQL query and save result to datatable. I am not fetching any value for the column from database, just using some random string to fill the field:

select [Shipment], ‘empty’ as [Column1]
from Table1

I can assing values to [Shipment], but to to [Column1], as it is read only.

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ----> System.Data.ReadOnlyException: Column ‘Column1’ is read only.
at System.Data.DataRow.set_Item(DataColumn column, Object value)
at System.Data.DataRow.set_Item(String columnName, Object value)