I suppose you could enable caching which may help with overall load but
won't specifically address your issue.
Declaratively, you don't have much choice. Dynamically, you can hook up the
control and specifically determine when it should query however, you'd need
to do this as an either or solution (either declarative and accept the load
on the database or dynamic with code).
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog:
http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"H5N1" <> wrote in message
news: oups.com...
> Hello
>
> I'm displaying report on a gridview through object data source which
> gets some parameters from ddl controls. Using sql profiler I've found
> out that even when controls are not yet set (by default they are set to
> empty string value, so I guess they should be interpreted as nulls)
> query (with empty parameters) is sent to sql server (it doesn't return
> anything). It causes unnecessary server load and slows down each
> postback, until all controls are set and gridview can display data.
>
> Isn't there any way to prevent the databinding and sending query to sql
> server until all object data source parameters are set (i.e. not null)?
> I know something like that is possible with sql datasource.
>
> I mean of course declarative way without adding additional biz. layer,
> but if it's not possible then I'd be glad to see any elegant solutions
> with small amount of additional code.
>
> thanks
>