Hi hb,
Thank you for posting in the community!
Based on my understanding, in your web form, you use datagrid to bind to
Sql Server database. Your data table has almost 800 records, and your data
retrieving time cost 2 seconds, on database server, but more than 1 minute
on web page.
=======================================================
How do you calculate your "retrieving time on database server"? Do you use
Sql Query Analyzer?
What does your "more than 1 minute on web page." mean? It means data
retrieving time or the whole web page render time?
What Sql sentence do you use?
Based on my experience, your data retrieving time is too long. You may
first determine whether the problem is due to the code or your system.
I use the code below to retrieve Sql Server's default table "orders" in
"northwind" database(This table contains 830 records), it only costs 0.160
seconds:
private void Page_Load(object sender, System.EventArgs e)
{
DateTime dt=DateTime.Now;
SqlDataAdapter adapter=new SqlDataAdapter("select * from
orders","server=localhost;database=northwind;uid=sa;pwd=");
DataSet ds=new DataSet();
adapter.Fill(ds);
TimeSpan ts=DateTime.Now.Subtract(dt);
Response.Write(ts.Seconds.ToString()+ " "+ts.Milliseconds.ToString());
DataGrid1.DataBind();
}
I think you may post in microsoft.public.sqlserver.programming group to
determine the Sql server performance issue. My colleague will hellp you
there.
For asp.net performance, you may use Custom Paging for datagrid to improve
performance, please refer to the article below:
http://www.dotnetjohn.com/articles/articleid28.aspx
Also, you need reduce the use of web controls in your web form to reduce
the viewstate.(You can determine if the viewstate is the bottleneck through
"view source" of your rendered page)
====================================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.