Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ODS + GridView -- how to prevent databinding when control parameters not yet set

Reply
Thread Tools

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

 
 
H5N1
Guest
Posts: n/a
 
      10-08-2006
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

 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      10-08-2006
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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Prevent ObjectDataSource/GridView from DataBinding richardl@conceptsearching.com ASP .Net 1 04-18-2007 06:08 PM
Gridview encoding, or how to run commands before gridview's default databinding, or, how do I disable default databinding at all? Sergei Shelukhin ASP .Net 1 11-12-2006 01:43 PM
GridView & ODS in another assembly Sebis ASP .Net 0 04-14-2006 08:25 AM
GridView ODS and ConvertEmptyStringToNull="false" Andrew Robinson ASP .Net 1 04-14-2006 07:30 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57