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

Discussion in 'ASP .Net' started by H5N1, Oct 8, 2006.

  1. H5N1

    H5N1 Guest

    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
     
    H5N1, Oct 8, 2006
    #1
    1. Advertising

  2. 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:...
    > 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
    >
     
    Alvin Bruney [MVP], Oct 8, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Robinson
    Replies:
    1
    Views:
    3,112
    Steven Cheng[MSFT]
    Apr 14, 2006
  2. Sebis
    Replies:
    0
    Views:
    381
    Sebis
    Apr 14, 2006
  3. Tina
    Replies:
    0
    Views:
    351
  4. Andrew Robinson
    Replies:
    5
    Views:
    1,253
    Walter Wang [MSFT]
    Feb 2, 2007
  5. Replies:
    1
    Views:
    855
    =?Utf-8?B?QnJhZCBSb2JlcnRz?=
    Apr 18, 2007
Loading...

Share This Page