If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > return multiple rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-10, 10:31
tchiloh tchiloh is offline
Registered User
 
Join Date: Nov 2009
Posts: 18
return multiple rows

i try get multiple values from stored procedure, but i get a error that are more than one values.

i will fill a combobox.

in the stored procedures i have:
select name
into param1
from clients


what can i do?
Reply With Quote
  #2 (permalink)  
Old 04-12-10, 12:03
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Quote:
select name
into param1
from clients
You are trying to store multiple values (actually tuples) into a single variable here.
How do you think that is going to work?

What exactly are you trying to return from your stored procedure?
Reply With Quote
  #3 (permalink)  
Old 04-13-10, 03:43
tchiloh tchiloh is offline
Registered User
 
Join Date: Nov 2009
Posts: 18
Quote:
Originally Posted by shammat View Post
You are trying to store multiple values (actually tuples) into a single variable here.
How do you think that is going to work?

What exactly are you trying to return from your stored procedure?
i try select all names from the table clients.

than in c#, i try fill a combobox with that data.
Reply With Quote
  #4 (permalink)  
Old 04-13-10, 03:57
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
you will need to create a cursor and loop through each of the results from the query and put them in one by one into the combobox with the data.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
  #5 (permalink)  
Old 04-13-10, 04:44
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Quote:
Originally Posted by tchiloh View Post
i try select all names from the table clients.

than in c#, i try fill a combobox with that data.
Why do you think you need a stored procedure for that?

That sounds like a trivial case of running a SELECT in C# and processing the result set (as it-iss.com has said as well)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On