ODS + GridView -- how to prevent databinding when control parameters not yet set

H

H5N1

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
 
A

Alvin Bruney [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top