should I use a datarow for this?

D

djc

I am retrieving fields from a database using a stored procedure that I know
will always only return 1 row. I would like to arrange my text boxes,
dropdown listboxes, etc... and bind the appropriate fields from this stored
procedure to these controls.

Can I return this one row of data directly into a DataRow object? or do I
need to use a DataAdapter and fill a DataTable, then access the DataRow?

Or more generally, what is the preferred way to retrieve 1 row of data and
bind the fields to webserver controls on the page?
any info is appreciated.
 
M

Miha Markic [MVP C#]

djc said:
I am retrieving fields from a database using a stored procedure that I know
will always only return 1 row. I would like to arrange my text boxes,
dropdown listboxes, etc... and bind the appropriate fields from this
stored
procedure to these controls.

Can I return this one row of data directly into a DataRow object?

No
or do I
need to use a DataAdapter and fill a DataTable, then access the DataRow?
Yes.

Or more generally, what is the preferred way to retrieve 1 row of data and
bind the fields to webserver controls on the page?
any info is appreciated.

Use DataReader and you won't need a DataRow/DataTable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top