Custom DataSource Extender
Posted
by Brian
on Stack Overflow
See other posts from Stack Overflow
or by Brian
Published on 2010-06-09T19:37:06Z
Indexed on
2010/06/16
21:22 UTC
Read the original article
Hit count: 246
I dream of creating a control which works something like this:
<asp:SqlDataSource
id="dsFoo"
runat="server"
ConnectionString="<%$ ConnectionStrings:conn %>"
SelectCommandType="StoredProcedure"
SelectCommand="cmd_foo">
</asp:SqlDataSource>
<Custom:DataViewSource
id="dvFoo"
runat="server"
rowfilter="colid > 10"
datasourceid="dsFoo">
</Custom:DataViewSource>
I can accomplish the same thing in the code behind by executing cmd_foo
, loading the results into a DataTable
, then loading them into a DataView
with a RowFilter
. The goal would be to have multiple DataView
s for one DataSource
with whatever special filters I wish to apply to the select portion of the DataSource
. I could imagine extending this to be more powerful.
I tried peaking at this and this but am a bit confused on a few points.
Currently, my main issue is being unsure where to grab the output data of the DataSource
so I can stick it into a DataTable
.
© Stack Overflow or respective owner