Large dataset displayed but kills application

Discussion in 'ASP .Net Datagrid Control' started by nkunkov@plusfunds.com, May 26, 2005.

  1. Guest

    Hi,
    It's my first try with C# and I'm clueless.
    I have a page where I input two dates, click a button that runs a query
    and binds it to a datagrid. When the dataset is relatively small, all
    is OK and I can click my button again and again and it will repopulate
    my screen. When my dataset is large (a few hundred rows), the data is
    displayed on the screen but when I click the button again to rerun the
    query and repopulate the datagrid, I get an error "page can not be
    displayed".

    here is some of my code:

    OracleDataAdapter da = new OracleDataAdapter(myCommand);
    DataSet ds = new DataSet();
    conn.Open();
    da.Fill(ds, "table");
    conn.Close();
    RegistryDataGrid.DataSource = ds.Tables["table"];
    RegistryDataGrid.DataBind();


    Another question I have is how can I set colors of a datagrid according
    to the data return. Lets say if I have "new" in my first column I want
    the row to be yellow....

    Your help is appreciated
    Thanks
    NK
    , May 26, 2005
    #1
    1. Advertising

  2. 1. How many columns do you have? How much text? Likely your few hundred rows
    just consume up all client resources. Restrict the volume of data to render.

    2. The most flexible way is to handle ItemDataBound event in code-behind. In
    the event you have access to the cells. You can check their context and set
    their visual properties. Also you can set the item properties. An item
    represents a row.


    Eliyahu

    <> wrote in message
    news:...
    > Hi,
    > It's my first try with C# and I'm clueless.
    > I have a page where I input two dates, click a button that runs a query
    > and binds it to a datagrid. When the dataset is relatively small, all
    > is OK and I can click my button again and again and it will repopulate
    > my screen. When my dataset is large (a few hundred rows), the data is
    > displayed on the screen but when I click the button again to rerun the
    > query and repopulate the datagrid, I get an error "page can not be
    > displayed".
    >
    > here is some of my code:
    >
    > OracleDataAdapter da = new OracleDataAdapter(myCommand);
    > DataSet ds = new DataSet();
    > conn.Open();
    > da.Fill(ds, "table");
    > conn.Close();
    > RegistryDataGrid.DataSource = ds.Tables["table"];
    > RegistryDataGrid.DataBind();
    >
    >
    > Another question I have is how can I set colors of a datagrid according
    > to the data return. Lets say if I have "new" in my first column I want
    > the row to be yellow....
    >
    > Your help is appreciated
    > Thanks
    > NK
    >
    Eliyahu Goldin, May 29, 2005
    #2
    1. Advertising

  3. Sonu Kapoor Guest

    DONT use a dataset, if you dont need all the feautures. You can use a
    datatable instead of the dataset. The Adapter also fills a datatable.

    --
    Sonu Kapoor - [MCP]
    ASP.NET Moderator
    WebSite: http://www.Kapoorsolutions.com
    Blog: http://www.Kapoorsolutions.com/blog/
    ASP.NET News: http://www.Kapoorsolutions.com/reblogger/


    "Eliyahu Goldin" wrote:

    > 1. How many columns do you have? How much text? Likely your few hundred rows
    > just consume up all client resources. Restrict the volume of data to render.
    >
    > 2. The most flexible way is to handle ItemDataBound event in code-behind. In
    > the event you have access to the cells. You can check their context and set
    > their visual properties. Also you can set the item properties. An item
    > represents a row.
    >
    >
    > Eliyahu
    >
    > <> wrote in message
    > news:...
    > > Hi,
    > > It's my first try with C# and I'm clueless.
    > > I have a page where I input two dates, click a button that runs a query
    > > and binds it to a datagrid. When the dataset is relatively small, all
    > > is OK and I can click my button again and again and it will repopulate
    > > my screen. When my dataset is large (a few hundred rows), the data is
    > > displayed on the screen but when I click the button again to rerun the
    > > query and repopulate the datagrid, I get an error "page can not be
    > > displayed".
    > >
    > > here is some of my code:
    > >
    > > OracleDataAdapter da = new OracleDataAdapter(myCommand);
    > > DataSet ds = new DataSet();
    > > conn.Open();
    > > da.Fill(ds, "table");
    > > conn.Close();
    > > RegistryDataGrid.DataSource = ds.Tables["table"];
    > > RegistryDataGrid.DataBind();
    > >
    > >
    > > Another question I have is how can I set colors of a datagrid according
    > > to the data return. Lets say if I have "new" in my first column I want
    > > the row to be yellow....
    > >
    > > Your help is appreciated
    > > Thanks
    > > NK
    > >

    >
    >
    >
    Sonu Kapoor, May 30, 2005
    #3
    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. Stefan Erl

    Online-HTML-Editor kills images

    Stefan Erl, Aug 8, 2003, in forum: Perl
    Replies:
    1
    Views:
    933
    J├╝rgen Exner
    Aug 8, 2003
  2. Tom Welch
    Replies:
    1
    Views:
    336
    Chris Jackson
    Nov 21, 2003
  3. Hardeep Rakhra
    Replies:
    11
    Views:
    571
    Jeffrey Silverman
    Jan 16, 2004
  4. boney
    Replies:
    1
    Views:
    540
  5. Ketchup
    Replies:
    1
    Views:
    228
    Jan Tielens
    May 25, 2004
Loading...

Share This Page