Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

Loop question

I need to return only one column from my stored procedure..

dr=ldata.getinfo(sucID)

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 dr.read()
label1.text =dr("C")


end while

it bypasses the line and not read it.
0
zachvaldez
Asked:
zachvaldez
  • 2
  • 2
1 Solution
 
CodeCruiserCommented:
Not sure I understand your question.
0
 
zachvaldezAuthor Commented:
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?
0
 
CodeCruiserCommented:
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.
0
 
zachvaldezAuthor Commented:
I chose option 3. Simpler!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now