I have a simple web part that I've added to my SharePoint 2007 site that containes a few labels, textboxes, a gridview, and a detailsview. This web part connects to SQL 2005 to retrieve data after clicking a button. There are no datasource objects except within the C# where they are created when they are needed (after button click). The issue is that the initial loading takes forever. We have about 10 other custom apps on our site and none of them load nearly as slowly as this one and it's probably the simplest of all of them (170 lines in C#, 165 lines in ASP.Net)
Does anyone have any idea why I am getting this degraded performance with such a simple application? I've done everything I could think of to improve the performance with no luck. If more information is required, I will do my best to provide it.
As I've mentioned, the application does not connect to SQL when it is initially loaded. the app is essentially a search of our internal data so until they fill out the search fields, no connection is made.
Thank You Corey
string sql; sqlconnection con; con.Open(); cmd = new SqlCommand(sql,con); sqldataadapter dapter = new sqldataadapter(cmd); dataset ID = new dataset(); adapter.fill(ID,"ID"); sqldatareader reader = cmd.executereader(); gridview.datasource=ID; gridview.databind();