Solved

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

Posted on 2013-11-12
2
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

740 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