Databind() of my data grid taking forever to execute

Last post 11-06-2009 12:17 PM by Jerry8989. 4 replies.

Sort Posts:

  • Databind() of my data grid taking forever to execute

    11-06-2009, 8:35 AM
    • Member
      8 point Member
    • Jerry8989
    • Member since 07-28-2006, 2:47 PM
    • Posts 31

    OracleCommand cmd = new OracleCommand(SQL, conn);
    OracleDataReader dr = cmd.ExecuteReader();
    grd1.DataSource = dr;
    grd1.DataBind();
    
    

     

    Data Reader gets the executed data but when it hits grd1.DataBind(); it takes a very long time.  My query is returning 3000 rows with no paging.

    Is there a good way to speed this up without paging?

    Thank You

    Filed under:
  • Re: Databind() of my data grid taking forever to execute

    11-06-2009, 9:46 AM
    • Member
      426 point Member
    • garuka
    • Member since 07-16-2009, 9:46 AM
    • UK
    • Posts 149

    what about giving a try to optimize sql query itself?

    btw read this article as well

    http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html


    Thanks
    /Garuka
    _____________________________________
    Please Mark as answer if it helps you
  • Re: Databind() of my data grid taking forever to execute

    11-06-2009, 10:31 AM
    • Member
      8 point Member
    • Jerry8989
    • Member since 07-28-2006, 2:47 PM
    • Posts 31

    garuka,

    The query is real quick.  It comes back in a few seconds then sits on the databind for a long time.

    I was sure it was the query but when I run "OracleDataReader dr = cmd.ExecuteReader(); " it comes back almost instantaly.

    But the binding of the 3000 rows is taking forever.

    Is there a way to optimize the binding?


    Thanks


  • Re: Databind() of my data grid taking forever to execute

    11-06-2009, 10:57 AM
    • Member
      426 point Member
    • garuka
    • Member since 07-16-2009, 9:46 AM
    • UK
    • Posts 149

    What type of query is this?

    What about using other option like

    • ExecuteNonQuery
    • ExecuteScalar

    This link states what to use when

    http://blogs.x2line.com/al/archive/2007/05/01/3049.aspx


    Also just read

    http://www.vb-helper.com/howto_net_enhance_executereader.html

    Thanks
    /Garuka
    _____________________________________
    Please Mark as answer if it helps you
  • Re: Databind() of my data grid taking forever to execute

    11-06-2009, 12:17 PM
    • Member
      8 point Member
    • Jerry8989
    • Member since 07-28-2006, 2:47 PM
    • Posts 31

    garuka,

    It is a normal select query.  I'm just pulling out data from an oracle db then displaying it in a grid.

    ExecuteReader would be the best way to go in that situation correct?


    Thank You


Page 1 of 1 (5 items)
Microsoft Communities