Solved

Can gridview retain it's data after postback

Posted on 2014-02-26
5
259 Views
Last Modified: 2014-03-25
This question is based on http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_28373722.html

I press a button to populate a gridview.  When I press the button again with different parameters, I want the new results to be added as an extra row to the gridview.  I don't want the new results to replace the old.

The gridview is populated by passing parameters to a stored procedure.  Obviously only one set of parameters can be passed at a time.

I'm using vb2008 with asp.net 3.5
0
Comment
Question by:AlHal2
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39892390
What are you using for the data source for the GridView?  If you are using something like the SqlDataSource, then it gets to be challenging.  If you are binding to a list structure or DataTable, then it should be easier.
0
 

Author Comment

by:AlHal2
ID: 39893147
I think I've solved the problem.
I've had a table created which will store the data that gets sent to the gridview.  The stored procedure updates the table and then runs a select query which is sent to the gridview.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39893304
What are you doing with the table when the page posts back?
0
 

Accepted Solution

by:
AlHal2 earned 0 total points
ID: 39894277
I've incorporated JamesBurger's solution to http://www.experts-exchange.com/Programming/Languages/.NET/Q_28375965.html

The stored procedure does what's necessary then displays the updated table.
That seems to work.
On the other post you talke about some database operations being synchronous, but not all.  Please could you elaborate?
0
 

Author Closing Comment

by:AlHal2
ID: 39952688
It works.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Code works but how can I download the file? 20 67
Execute Stored Procedure for a set of values 5 44
Error in JQuery 5 39
Need a starter for ETL protocol? 4 43
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

19 Experts available now in Live!

Get 1:1 Help Now