Hi @Mansour_Dalir ,
Use a For Each
loop to iterate through each row in the DataTable to call the MyFunc function with the Age
column value to assigne the isOk
column result for each row.
For Each row As DataRow In MyTable.Rows
row("isOk") = MyFunc(row("Age"))
Next
Function MyFunc(InAge As Integer) As Boolean
If InAge >= 10 And InAge <= 20 Then
Return True
Else
Return False
End If
End Function
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.