How do I read data from a SP that exec 2 selects?

trend

Well-known member
Joined
Oct 12, 2004
Messages
171
Hello, I connect to my db over oledb connection.

I open
Code:
        Dim myCmd As New OleDb.OleDbCommand("sp_whatever")
        Dim myReader As OleDb.OleDbDataReader


        myCmd.Connection = MyConnection
        myCmd.CommandType = CommandType.StoredProcedure

        myCmd.Parameters.Add("@value", value)

        Try
            MyConnection.Open()

            myReader = myCmd.ExecuteReader
but then from there.. i try to myreader.getstring(0) (I get back 6 variables).. and I keep getting an error saying that there is no text in the column or something like that. I know this sp returns 2 tables if you will ..because I exec sp_whatever directly to the db server.

I think my problem is something new that I am trying to learn to do.

I basically have a sp like:

create procedure dbo.whater @value char(15)

as

select value, value2
from yada
where @value = value

select value3, value4
from yada2
where @value = value

go


Well.. my syntax on the SP might not be right (as i am typing from my head).. but you see what I am doing.. How am i suppose to get returned value from 2 select statements?


thanks!
 
Back
Top