Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning Results from a Stored Procedure to a Recordset

Status
Not open for further replies.

HARLEY12

Programmer
Jan 12, 2005
9
US
How is this done in VB.Net? I have the following code but it is not working:

rsGetNotes.Open("GetNotes"), CN, ADODB.CursorTypeEnum.adOpenStatic)

I would have thought that the results of this recordset would now be located in rsGetNotes.Fields(0).value, but the recordset never even opens. What am I doing wrong?

Thanks!
 
What exactly would you like to do? I work a lot with stored procedures but not like you wrote.
Look at the DataAdapter and OledbCommand classes.
 
Korach, that looks like the VB6/ADO way of getting a recordset(rsGetNotes) from a stored procedure(GetNotes).

Harley, This might point you in the right direction
Code:
Dim ocmd As OleDb.OleDbCommand
ocmd.CommandType = CommandType.StoredProcedure
ocmd.CommandText = "GetNotes"
Dim dataReader As OleDb.OleDbDataReader = ocmd.ExecuteReader

-Rick

----------------------
 
Thanks guys! Yes I needed to use commandtext to get it to work correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top