?
Solved

Populate the Dataset or Data table once

Posted on 2015-01-19
2
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

762 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