.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Performance issue with GridView

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

Hi All,

             i am facing performance issue while using the datagrid in my project, i am writing my code here please correct me if i am writing something wrong.

i am using sql server 2000 in which i have a table containing around 600000 records and i can not put any indexing on this table as this is the staging table for me .

now To show these record on front end i am using gridview with Allowpaging = "True" now in the PageIndexChanged event i have to again hit the database and bind the grid which results very slows performance as just to change the page i have to read 600000 records again and again, i am giving some idea below what i am doing

Public Void BindgridView()


//do database connection

//fill the dataset through adapter

Gridview.datasource = dataset();



protected void GridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
      GridView1.PageIndex = e.NewPageIndex;

Any idea how can i imrove the performance, Please help me out..



View Complete Post

More Related Resource Links

Gridview Performance Issue

Hi All, I have one ASP.NET Application (VS.NET 2005). In that i have one scenario where i have to display 500 records per page (Not less than that bcoz this is client requirement to display 500 records per page) in the Gridview. This functionality is working fine but the application is becoming very slow. Can anybody tell me the solution for increasing performance in this case ???? VERY URGENT...PLZ REPLY SOON Thanks, Biswajit

Grouping Issue in Gridview

Consider Table in Database Table Name: Work_Order   Work_Id Height Width Thickness Material Shape 11-1 20.3 32.5 50.2 Steel U 11-2 20.3 32.5 50.2 Steel O 11-3 20.3 32.5 50.2 Steel U 11-4 22.3 32.5 50.2 Iron V 11-5 22.3 32.5 50.2 Iron V 11-6 30.3 52.5 63.2 Steel O 11-7 30.3 52.5 63.2 Steel U   Please Provide me the Sqlcommands and method to display the above in an asp.net  Grid View as shown below.   Material Height Width Thickness Shape Steel         11-1 20.3 32.5 50.2 U 11-2 20.3 32.5 50.2 O 11-3 20.3 32.5 50.2 U Steel         11-6 30.3 52.5 63.2 U 11-7 30.3 52.5 63.2 U Iron         11-4 22.3 32.5 50.2 V 11-5 22.3 32.5 50.2 V  Basically I would like group above by Material and check if Height,Weight, Thickness (shape not beconsidered) are same.Is it possible to display the above?

Gridview Grouping issue

Consider a table in DatabaseTable name: Work_OrderWork_Id     Height        Width        Thickness    Material     Shape11-1             20.3cm       32.5cm       50.2cm        Steel            U 11-2             20.3cm       32.5cm       50.2cm        Steel            V11-3             42.3cm       72.5cm       80.5cm        Steel            O11-4             42.3cm       72.5cm       80.5cm        Steel            U11-5             30.3cm       62.5cm       25.2cm        Iron              V11-6             30.3cm       62.5cm       25.2cm        Iron              U Please Provide me the Sql commands a

Performance Issue on SQL 2008 Box

Will SSRS and SSIS running on the same machine would hinders the perfromance of a database engine. 1. If so to what extent? 2. How do you tackle this kind of issue. 3. Is there a way you can separate these services from running on the same machine. The machine also has a OLTP database running on it.

XOML only workflow performance issue while creating

  In our application we are using XOML workflow and create workflow instance using workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters) where workflow and ruleReader are objects of XMLReader created using XmlReader.Create().For one of our business process automation we have developed XOML only workflow which has 35 states and 95 events. When we try creating an instance of the workflows it is taking more time and the time taken to create the instance is 3 min.Can any one suggest is there any other way to create workflow instance of XOML only workflows other than workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters)Your help is higly appreciated.Environment:    VS 2008    ASP.NET 3.5    WWF 3.5    XP  

Gridview placing issue

hi all,       Actually I am binding 5 gridviews on a form. I done that if gridvew having nay data then it should visible others wise invisible.       there  all 5 gridvew may have data or not and may be 2 or 3 of them having data, depens on the condition.        If gridview1, gridview2, gridview3 dont bind any data then they dont appear on the form only gridview4, gridview5 are binding data and they are appearing on the form. but ther are very down in the form, what I want is ; which ever gridview bind the data it showld not show space bitween form head and the gridview, means if upper all 4 grid are not binding and 5th is binding the it should not appear in the bottom of the form instead it should visible on the top. it's like there are no grid except this grod on the form, i dont need to scroll the form to view the grid.thanksGaurav

dropdownlist controls in gridview issue

 the below code creates drop down each time i add a category to the database table. however, i don't wish to have drop down created each time - how can i have all my data in one drop down? thanks...  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CascadingDropDownTestConnectionString %>"  SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Category]">  </asp:SqlDataSource>    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID"  DataSourceID="SqlDataSource1">  <Columns>  <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False"  ReadOnly="True" SortExpression="CategoryID" />  <asp:TemplateField HeaderText="Categories">  <ItemTemplate>  <asp:DropDownList ID="ddlCategories" AutoPostBack="true" DataTextField="CategoryName"  DataValueField="CategoryID" DataSourceID="SqlDataSource1" runat="server" AppendDataBoundItems="true"  SelectedValue='<%# Bind("CategoryID") %>' />  &

Gridview Fixed Header Issue


   position:relative ;
   z-index: 10;
2.Assign Datagrid Header's cssClass to Freezing
<HeaderStyle ... CssClass= "Freezing" ...></HeaderStyle>


This is working fine in Internet Explorer but not working in firefox. can anybody please help me to say why its not working in firefox

.NET 4 Performance Issue String IndexOf



I have a performance issue with the new dot net 4.0 framework.

When i use the function String.IndexOf(string, stringcomparison.ordinalignorecase) my execution time is much higher than framework 3.5 (i had 30ms in a loop for 3.5 and 210ms in framework 4)

All other StringComparison mode are really good in framework 4.

Is there an explanation?

performance issue


i am having an issue in queying a table. This is something thats happening since the last 2 days. whenever i try to open a table (rightclick --> open table ) it errors  out saying the query time out period elapsed before the completion of the operation or server is not responding. But when i query select * from tablename..it is taking some time but is returning the results. The query time out period is set to 0(indefinite time out). we have never seen this kind of issue before. There are no open transactions either to assume that something is locking the system(dbcc opentran returns there are no open trans). Wondering why this is happening and also the performance of the system has gone down completely. Please help us in this issue. I checked the indexes for fragmentation and could see in some of them avg_fragementaton_percent like 60, 70, 80. i guess it is not good to have high such a value, so i ran dbcc reindex but still did not improve the performance. the avg_fragmentation was still the same.

Please advice. 

Issue with WCF performance


We have several WCF (3.5 hosted in IIS7) web services that are having some strange and inconsistent performance issues. In some environments they run fairly quickly. In others they time-out even if we significantly increase the timeout. We have tried all of the advice for performance tuning an IIS 7 hosted WCF service to no avail.

The svc log however shows some odd beheavior I am not sure how to interpret. I will get a message saying Opened System.ServiceModel.InstanceContext/..... The next message will say "A message was read". all good except it takes over six minutes sometimes. I do not follow these logs well enough to understand what could be causing this.

If anybody could provide any help or guidance, it would be greatly appreciated.

Best regards,


 Additional information: Just realized that the servers where we are having the large delays reading the message have Symantec "Data Endpoint Security" installed. Seems like it could be related. anybody have familiarity with this AV client and WCF?

Performance Issue.



I have a query which involves a table and a function. Table has got around 59 crores of records and the function returns 56k records. There is a inner join between with function being on the left side. This query takes around 2 minutes to execute. I wanna improve the performance to few seconds.

I made sure that the table has all required indexes but still was not able to improve the performance.

Please suggest what else i can do to improve performance.







Sql Server compact Edition Performance issue

I was  trying to insert a .wav file to sql server CE..The file is of size 1 Mb,but it takes a long time to perform the action (more than 1 min).Anybody have solution ? please help me..

Performance Issue


we did a performance check on production and found that an object is missing from the Layout page which causes the below error frequently.

 When we check the log file we get the below error

1. SearchUpgradeGetKeywordPropertyBag keywordsPropertyBag is null

2. Cannot open file "Resources.en-US.resx" for reading.
(#3: Cannot open file "Resources.resx" for reading.)


Most of the time SearchUpgrade and Cannot open file error are followed by While Initializing navigation error.

And we receive a deadlock error in the IIS(ISAPI.dll) at the same time when we receive this error.

vs 2010 performance issue


we have migrated our application from vs 2005 to 2010 we found that page loading time is increased 

any idea why this is happing or how to improve it 

One Gridview & Multiple CommandText Issue on Paging


Hi All,

I am using a gridview to display data from two separate functions. [VS 2010 on Framework 4]

This works fine without paging. On paging, clicking 'next page' invokes the older data(of function 1) instead of that in the new function (function 2) Cry


' Function 1

cmd.CommandText = "select * from table1,
Dim dTable As DataTable
Dim dataAdapter As SqlDataAdapter
            dTable = New DataTable
            dataAdapter = New SqlDataAdapter(cmd.CommandText, AquisitionString)

'Function 2

cmd.CommandText = "select * from table2,
Dim dTable As DataTable
Dim dataAdapter As SqlDataAdapter
            dTable = New DataTable
            dataAdapter = New SqlDataAdapter(cmd.CommandText, AquisitionString)

'Handling PageIndexChange

   Protected Sub grdAcquisition_PageIndexChanging(ByVal sender As Object, _
       ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdAcquisition.PageIndexChanging

display message if gridview has no row issue


(1) i want to show message if no data row is found in the grid. but my code below does not achieve this. basically if gridview shows data then i want my panel (booking form) to be made visible otherwise hidden. the booking form panel is set to visible false. my else statement is not working...

        protected void btnCheckFlightAvailability_Click(object sender, EventArgs e)
            if (Page.IsPostBack)
                this.gvSingleFlightSearch.DataSourceID = "CheckSingleFlightDataSource";

                if (gvSingleFlightSearch.EmptyDataText != null)
                    pnlFlightAvailableMessage.Visible = true;
                    lblAvailableFlights.Text = "Flight Available";
                    gvSingleFlightSearch.Visible = true;


                        pnlFlightAvailableMessage.Visible = false;
                        lblAvailableFlights.Text = "No Flight Available";
                        gvSingleFlightSearch.Visible = false;

(2) one of the field in my grid view is price while a texbox in my booking form is passenger numbers. how can i use the value entered

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend