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
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