Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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

Edited by Harvey
Posted

Something like:

 

       Dim dt As New DataTable
       Dim iLp, ilp2 As Integer

       'assumes you've 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

Here's what I'm up to.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...