Feed repeater from sqldatareader

E

eje

I am using several repeaters in a web application, mainly
for readonly use. Today I feed the repeaters from
sqldatareaders via rather inefficient code. I use
datareaders because I have read that it is most efficiant
for the sql server.

I want to keep the datareader separate from the
codebehind and call a function with the datareader from
the codebehind.

In the repeaters I use 'DataBinder.Eval
(Container.DataItem, "Number")' for binding. Here I need
to know the name of the field, in this case 'Number'. In
the datareader I can catch the fieldname.

I have a feeling it would be possible to have a 'generic'
function using a datareader and with a sql string as
input and i.e. an arraylist as output. The output must
include the fieldnames in a way that makes it possible to
directly bind the arraylist to the repeater and use the
above databinder to get the values. I have not managed to
build such an arraylist. Is it possible and is it the
most efficiant way to bring data from the server to the
repeaters?

Eje
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top