Solved

Populate the Dataset or Data table once

Posted on 2015-01-19
2
150 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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