dataset.databind() very slow
-
I have a web app which is gets data from an sql server. the code returns a data set which i bind to a datagrid, see code; private void Button2_Click(object sender, System.EventArgs e) { remote.helpdesk rem = new remote.helpdesk(); DataSet ds2 = new DataSet(); TextBox3.Text = DateTime.Now.ToLongTimeString(); ds2 = rem.runQuery("select * from problems"); TextBox4.Text = DateTime.Now.ToLongTimeString(); DataGrid2.DataSource = ds2; DataGrid2.DataBind(); } straight forward enough but if i try and return too many rows in the datagrid it takes AGES and the page times out. I would have thought the datagrid would be designed to work with many rows? Is there any way i can speed this up so the page loads quicker? Thanks Colin
-
I have a web app which is gets data from an sql server. the code returns a data set which i bind to a datagrid, see code; private void Button2_Click(object sender, System.EventArgs e) { remote.helpdesk rem = new remote.helpdesk(); DataSet ds2 = new DataSet(); TextBox3.Text = DateTime.Now.ToLongTimeString(); ds2 = rem.runQuery("select * from problems"); TextBox4.Text = DateTime.Now.ToLongTimeString(); DataGrid2.DataSource = ds2; DataGrid2.DataBind(); } straight forward enough but if i try and return too many rows in the datagrid it takes AGES and the page times out. I would have thought the datagrid would be designed to work with many rows? Is there any way i can speed this up so the page loads quicker? Thanks Colin
colin mcadam wrote: straight forward enough but if i try and return too many rows in the datagrid it takes AGES and the page times out. How many rows are you adding? I've had upto 10,000 rows in a datagrid and it worked well (considering the quantity of data). Or, is it your database query that is taking a long time?