Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid filling too slow

Status
Not open for further replies.

ernatlas

Programmer
Jan 17, 2007
8
0
0
MX
Hello everyone, can anyone help me??.
I have a datagrid, in which i display the result from a query that i do from a remote database. The result is not too long, but it gets very slow to get the datagrid filled.
Here is part of my code.

String ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=*********;Port=****;Database=****;User=*****;Password=*******;Option=3;";
DataSet MySQLDataSet = new DataSet();
query = "select * from cat_adquisiciones;";
OdbcDataAdapter MySQLDataAdapter = new OdbcDataAdapter("" + busqueda, ConnectionString);
MySQLDataAdapter.Fill(MySQLDataSet, "consul1");
this.tabla.DataSource = MySQLDataSet.Tables["consul1"].DefaultView;
 
You probably should be using OLEDB if you are concerned with speed.

And how big is your result set?

Ignorance of certain subjects is a great part of wisdom
 
has this always been a problem with the routine, or did this just start slowing down?
have there been any major changes to the db schema?
how many records are you attempting to pull?
how many fields are in this table?
do you display all the records on screen at once, or do you allow paging?
what hardware is the database running on?
what hardward is the application running on?
do you get the same preformance hit if you explicitly list which columns to pull instead of using *?

Some articles state that using * instead of explicitly requesting each column requires more processing power.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Oh I thought you said SQL, just realized it was of the 'My' variety. Not sure if there is an oledb provider for MySQL (although I would think that its' big enough these days that there darn well should be!)

I would bet that paging/scrolling will speed things up as well, I have had a few cases pulling large resultsets where the data grid took forever to render on the screen.

Ignorance of certain subjects is a great part of wisdom
 
also... make sure there are no large values in the watch area :)

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top