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
.