Loop question

Posted on 2012-09-14
Last Modified: 2012-09-17
I need to return only one column from my stored procedure..


getinfo has this; Select  A,B,C,D..from table

But I need only to get C from the select to return.

what is the code to get it...

Im using

 while not
label1.text =dr("C")

end while

it bypasses the line and not read it.
Question by:zachvaldez
    LVL 83

    Expert Comment

    Not sure I understand your question.

    Author Comment

    My select in my store proc has several fields.
    can I use the same sp to return just 1 column.
    if col 1 is Id, col2 is name, col 3 is address.
    can i return just the name? ignore other fields.
    Or should I create a new sp ust to return the name?
    LVL 83

    Accepted Solution

    There are multiple options

    1) Leave the SP as it is and just use the requirement column on client side, ignoring extra columns.

    2) Add a parameter to SP so that it returns a different resultset depending on this parameter value.

    3) Add another SP.

    Author Comment

    I chose option 3. Simpler!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video discusses moving either the default database or any database to a new volume.

    760 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

    14 Experts available now in Live!

    Get 1:1 Help Now