Performance question...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a DataBase that have some tables with more then 1 Million records.
I notice that the query is executed quite fast, but to put the data in a datagrid it's a bit slow, I Think dataset is slowing this operation...
Here is my code.
md = new OleDbCommand(SQL,dbConn);
da=new OleDbDataAdapter(cmd);
da.Fill(ds,"VEHICLE");
dtgVeiculos.DataSource = ds.Tables["VEHICLE"];
dtgVeiculos.TableStyles[0].MappingName= ds.Tables["VEHICLE"].ToString();

Do you know I can I improve the data Placement in datagrid for exemple?
Is datagrid the best control to put the data?

Thanks for your help,
BP
 
Hi,

You are not showing the 1m rows at once right?

Even if you are not placing them on a grid having a 1m records dataset may
be TOO heavy to keep them in memory. both in memory compsuption and in
processing.


Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Bernardo Piano said:
Hi,

I have a DataBase that have some tables with more then 1 Million records.
I notice that the query is executed quite fast, but to put the data in a
datagrid it's a bit slow, I Think dataset is slowing this operation...
Here is my code.
md = new OleDbCommand(SQL,dbConn);
da=new OleDbDataAdapter(cmd);
da.Fill(ds,"VEHICLE");
dtgVeiculos.DataSource = ds.Tables["VEHICLE"];
dtgVeiculos.TableStyles[0].MappingName= ds.Tables["VEHICLE"].ToString();

Do you know I can I improve the data Placement in datagrid for exemple?
Is datagrid the best control to put the data?

Thanks for your help,
BP
 
Bernardo Piano said:
Hi,

I have a DataBase that have some tables with more then 1 Million records.
I notice that the query is executed quite fast, but to put the data in a datagrid it's a bit slow, I Think dataset is slowing this operation...
Here is my code.
md = new OleDbCommand(SQL,dbConn);
da=new OleDbDataAdapter(cmd);
da.Fill(ds,"VEHICLE");
dtgVeiculos.DataSource = ds.Tables["VEHICLE"];
dtgVeiculos.TableStyles[0].MappingName= ds.Tables["VEHICLE"].ToString();

Do you know I can I improve the data Placement in datagrid for exemple?
Is datagrid the best control to put the data?

Thanks for your help,
BP

Do you retrieve all 1m values in your query? A datagrid can use paging
so it might show 20 records, but it needs to process all 1.000.000 records.
If you didn't disable viewstate, those 1m records get stored in viewstate
as well (do a "view source" in IE, store as a file and look at the size)!

With these numbers you might be better of to get just a single page worth of
records from the database, and handle paging yourself.

Hans Kesting
 

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

Back
Top