Solved

Help with passing table names and testing if table exist in For Next Loop

Posted on 2013-11-12
2
212 Views
Last Modified: 2013-11-13
Hi,

I have max 4 tables (Country, NSN,NSC,NAA) in my LinkSearch File, How do I modify the code below to search for all 4 tables and encrypt if they exist?

Dim sec As New Security
        For i As Integer = 0 To dtsetlinkBEL.Tables(0).Rows.Count - 1
            For j As Integer = 0 To dtsetlinkBEL.Tables(0).Columns.Count - 1
                dtsetlinkBEL.Tables(0).Rows(i).Item(j) = sec.psEncrypt(dtsetlinkBEL.Tables(0).Rows(i).Item(j))
            Next
        Next
        dtsetlinkBEL.WriteXml(Application.StartupPath + "\LinkSearch.xml")


Thanks,

Victor
0
Comment
Question by:vcharles
2 Comments
 
LVL 10

Accepted Solution

by:
joriszwaenepoel earned 500 total points
ID: 39643837
Dim sec As New Security
For t as Integer = 0 to dtsetlinkBEL.Tables.Count-1
       For i As Integer = 0 To dtsetlinkBEL.Tables(t).Rows.Count - 1
            For j As Integer = 0 To dtsetlinkBEL.Tables(t).Columns.Count - 1
                dtsetlinkBEL.Tables(t).Rows(i).Item(j) = sec.psEncrypt(dtsetlinkBEL.Tables(t).Rows(i).Item(j))
            Next
        Next
Next
        dtsetlinkBEL.WriteXml(Application.StartupPath + "\LinkSearch.xml")
0
 

Author Closing Comment

by:vcharles
ID: 39645318
Thank You.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now