This seems to work, but it's a bit clunky:
If the only way to get the dataview is to call objDataSource.Select(), we
need to prevent the automatic databinding, otherwise a second SQL call will
result. I did the following in Page_PreRender:
DataView dv = myDataSource.Select() as DataView;
myDataSource.DataSourceID = null; // break the auto-binding
amyDataSource.DataSource = dv; // allow it to respond to manual
binding
DataBind();
This results in only one call to the SQL, and a dataview you can work with.
It would be so much better if this was made available in
ObjectDataSource.Selected
John
"John" <jo**@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I double checked, e.ReturnValue is a strongly typed datatable, not a
dataview.
I found that calling objDataSource.Select() returns a dataview with the
filter applied, *but* this seems to result in a double call with the built
in databinding - unless you turn caching on.
Any ideas how to avoid the double call?
John