Solved

Populate the Dataset or Data table once

Posted on 2015-01-19
2
142 Views
Last Modified: 2015-01-19
I am selecting data from SQL  then I fill a data table with data then populate a grid view with data and would like to perform the select process only one time what happened is that every time I click on gridview page or a button the data gets populated again and the order of the data has changed.

C# ASP.net
0
Comment
Question by:UKIT
2 Comments
 
LVL 33

Accepted Solution

by:
paulmacd earned 500 total points
ID: 40557744
Put the code to fill the datatable in a section that checks for a postback:

IF NOT IsPostback THEN
  ...select for and populate datatable
END IF
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40557802
As Mr. Paul said you should manage it in IsPostback, beside you should save the dataset in session and use it if it is a PostBack, or turn on  ViewState if you only want to keep data on Grid
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expando 4 36
Jquery autocomplete 10 31
Performance  Html.BeginForm vs jQuery 3 15
Birthdays 3 22
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now