Some kind of loop?

Posted on 2008-11-19
Last Modified: 2013-12-17
What I want to do - is to take X amount of values and for each, perform a loop and execute a SPROC in my data-layer - I am sure this is easy and have everything I need except how to grab each value and loop the execute...
Question by:tbaseflug
    LVL 5

    Expert Comment

    Sounds like a basic For loop to me.

    Author Comment

    Can you give me an example?  Say I have three string values I am setting and I need to execute a code block for each?
    LVL 13

    Expert Comment

    Depending on the type or data you want to loop through. If it's a collection then it should be something like:

    for each Item in CollectionVariable
             'do stuff here..

    Hope this helps...
    LVL 13

    Accepted Solution

    That was VB.

    A C# example:

                foreach (string sForm in Request.Form.Keys)
                    'do code here


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 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

    15 Experts available now in Live!

    Get 1:1 Help Now