I need the ability to loop through a datatable but every value needs to be evaluated in each rows column. I do not know how many columns or rows so it needs to be index based. The bigger picture is that I am trying to build a function that takes in an encrypted datatable and returns an unencrypted datatable.
Everything is in place for all the encryption/decryption but I cannot seem to access each value. I can access a row or a column but not the "item(i)" that needs looped through.
Each row has its own IV and Key coming from the database so each row needs evaluated to extract the IV and Key so that the row can then use the decrypt function to decrypt the "item(i)" I cannot seem to access.
Any help would be greatly appreciated!
Thanks in advance,
Public Shared Function SQLStoredProcDT(ByVal DT As DataTable) As DataTable
Dim rows As Integer = DT.Rows.Count
Dim cols As Integer = DT.Columns.Count
Dim myDT As New DataTable()
Dim dc As DataColumn
For Each dc In DT.Columns
Dim dr As DataRow
For Each dr In DT.Rows
For Each col As DataColumn In DT.Columns
Dim IV As String = DT.Columns("IV").ToString
Dim EKey As String = DT.Columns("EKey").ToString
Dim rij As EncryptionAlgorithmType = EncryptionAlgorithmType.Rijndael
For i As Integer = DT.Columns.Count
DT.Rows.Add(DecryptString(dr(i - 1).Item(i - 1), rij, EKey, IV))
Catch ex As Exception