[RESOLVED] For loop replace item in data table
Hello people I have made a data-table that contains 20 different columns.
I use my data-table to put the SQL Query results.
My issue is... I need to clean/clear items from my data-table while the for loop is running.
in this case below I want to update the data-table if the certain item column 18 does not contain "Language" replace with "0"
here is my code:
Code:
If HashDatatable1.Rows.Count > 0 Then
For i As Integer = 0 To HashDatatable1.Rows.Count - 1
If Not HashDatatable1.Rows(i).Item(18).ToString.Contains("Language:") Then
End If
Next
End If
Could someone help me?
Thank you in advance
Re: For loop replace item in data table
already solved by myself..
Code:
For Each dc As DataColumn In HashDatatable1.Columns
dc.ReadOnly = False
Next
also
Code:
If HashDatatable1.Rows.Count > 0 Then
For i As Integer = 0 To HashDatatable1.Rows.Count - 1
If Not HashDatatable1.Rows(i).Item(18).ToString.Contains("Language:") Then
HashDatatable1.Rows(i)(18) = "0"
End If