Large dataset displayed but kills application

N

nkunkov

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
 
E

Eliyahu Goldin

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
 
S

Sonu Kapoor

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 said:
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

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
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top