ADO.Net- programatically changing dataset values

Harvey

New member
Joined
May 11, 2005
Messages
1
My challenge right now is to encrypt the data stored in a database with a VB.Net application I am developing. I have a function to encrypt the data, but I can not figure out how to send it values in the dataset.

I have no problems binding controls to my dataset, but when the application opens I want to send each value in the dataset to the function that decrypts the value so the data can been interacted with by the user. Then I want to send each value to a function to encrypt it when the app closes. This way the data stored in the database will always be encrypted.

I can not find a way to edit values in the dataset unless it is through a bound control.

Is there a way to populate an array with the dataset, change the values in the array, and repopulate the dataset? Or any better ideas? I am new to ADO.Net.

Thanks in advance-
Harvey
 
Last edited by a moderator:
Something like:

Code:
        Dim dt As New DataTable
        Dim iLp, ilp2 As Integer

        assumes youve filled the datatable

        For iLp = 0 To dt.Rows.Count - 1
            For ilp2 = 0 To dt.Columns.Count - 1
                dt.Rows(iLp).Item(ilp2) = Decrypt(dt.Rows(iLp).Item(ilp2))
            Next ilp2
        Next iLp

        dt.AcceptChanges()

        bind to controls
 
Back
Top