.net - How do ASP.Net controls read from their data sources? -
i have need display information on pages in way none of standard asp.net controls support. in order this, i've created own controls, , had reproduce of functionality of asp.net form controls - capacity bind number of different data sources.
according documentation, controls can bind data source supporting ienumerable, icollection, or ilistsource interfaces. know can bind controls directly sqldatareader, can't work out interface class conforms allows work. iirc implements ienumerable enumerating columns, not rows.
i want own objects able consume these data sources, , have way of doing (using reflection access properties dynamically, etc), since .net framework this, i'm hoping there's object part of framework, eliminating need me roll own. questions:
1) condition sqldatareader meet allow used data source asp.net controls? 2) there class can iterate on allowed asp.net data sources row row, avoiding need roll own?
i don't know if answers question, can iterate on sqldatareader using dbdatarecord class (and in case ienumerable iterates on rows) e.g. (vb.net):
for each rec data.common.dbdatarecord in myreader 'access fields rec(ordinal) or rec(fieldname) next
Comments
Post a Comment