Solved

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

Posted on 2013-11-12
2
214 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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