I want to loop through a databale and change the values of a specific column in that datatable.
eg: the database returns Request_ID
, Desc
, Date
and Status_Ind
. The Status_Ind
column contains integer values. I dont want to show the integer values to the user. I want to convert that to a string value based on the integer values returned in that columns.
if Status_Ind = 1 then
'the values changes to Published
Assuming your DataTable is defined as this:
First you need to add a new column to your DataTable to hold the Status:
Now Loop through the DataTable and update the status column:
Then you could then remove the integer column:
You could do it by creating another column: