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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I access a single row in an SqlReader object?

Status
Not open for further replies.

BlueBlade

Technical User
Joined
Mar 2, 2007
Messages
15
Location
US
Hi, I'm calling a stored procedure which return a sqlReader object. I would like to know how to retrieve a specific row or record from the reader and store it in a textbox. Can anyone help me with this or show me a link that may be able to help?

Thank you so much,

BlueBlade
 
Can you clarify a little more. First, I assume you mean the SqlDataReader. Second, do you mean a specific row like stick row #5 into a textbox?

The DataReader is really meant more for looping through it to get data (forward only/read only). A DataSet may be better in this situation. Here's a link on how to convert a SqlDataReader to a DataSet:
Ron Wheeler
 
Yes I do mean a SqlDataReader and yes I want to get the data from a single row like row 5 and put it in my textbox. Then when my user is ready to see the next record, he/she can click a button to advance to the next row in the dataSet or SqlDataReader. I haven't done so yet but I'll take a look at the link that you suggested.

Thanks,

BlueBlade
 
Keep in mind that a Data Reader is forward reading only. If the user is going to page through things, use a DataSet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top