Hey
I have an application that displays a large quantity of data in a dataGridView control. Even more, I have to "translate" some of the data (some columns in database are numerical although they represent a textual value). My application works fine, but is slow in some sections (I divided it into user defined controls, so the data is not withdrawn all at once, however some sections simply have many entries that need to be displayed). My question is how can I speed this up? I have no idea so any suggestion is very welcome. I'm using VS 2010 to make my application.
Thanks
Loading
Neven DraskovicPosted May 4, 2012, 7:39 AM
SenthilkumarPosted May 4, 2012, 7:17 AM
This should be fast.
Because you need the stored procedure should have the parameters some thing like
@PageNumber
@Pagesize
@column
@Sorting
Here when use click on 2nd paging then
@PageNumber = 2
@PageSize = 25
@Sorting = ASC
Here it will return only 25 records from total of 500 records.
You need to check the stored procedure performance by using the query estimation plan and tune it.
Neven DraskovicPosted May 4, 2012, 7:08 AM
command.CommandText = ".....";
command.Connection = myConnection;
mySQLDataAdapter.Fill(myDataSet);
dataGridView1.DataSource = myDataSet.Tables[0].DefaultView
So far this worked perfectly, but now I have to display a table form database that has almost 500 entries and like I said one of columns is a numerical representative that I need to change into a textual description. I cant use INNER JOIN's because the textual equivalent of that representative does not exist in the database, and I'm not allowed to add new tables, only use the existing ones.
SenthilkumarPosted May 4, 2012, 7:01 AM
what you need to do is do not pull the data once into the DataSet or something.
Retrieve the data on demand and using the stored procedure to retrieve the data which is exactly required for the current page in the gridview.
This will help you to improve the performance, because it will not take much time to query the data and avoid huge view state in the client side.
http://www.codeguru.com/csharp/.net/net_asp/controls/article.php/c15145/Custom-Paging-for-GridView.htm