Solved

c# how can I use a temporary table to collect and display data before writing it permanently into the database.

Posted on 2007-04-04
2
268 Views
Last Modified: 2012-05-05
I have an aspx page that conatins a gridview a dropdownlist a textbox and a button.

I use a tableadapter to bind a table to the dropdownlist.

The user selects an item from the ddl enters a value into the textbox and click the button.

Based on what the user selects and enters rows need to get added to teh table that is bound to the grid view.. So the grid view basically gets populated as the user is selecting items from the ddl and clicking the button.

Eventualy the user will click another button and the values in teh grid view will get written to a series of tables in the database.

My question is this...what is the best approach to handling the table that is bound to the gridview.

I have though about creating a programmatic table and having it be persistent while the page is active and binding it to the gridview though I havent quite worked out how to accomplish that yet.

Easier stil would be to have an empty table in teh database that I could bind to the gridview throgh a tableadapter and just write the values to that table..then at the end write those values to their legitimate tables in the database and finish up with deleting everything in this "temp" table location.

I am guessing that there is a best practice to follow in this regard..some kind of system that allows me to collect data into a "temporary table" that I can display in a gridview before finally writing that data to a database...

0
Comment
Question by:Prysson
[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 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 18852225
how much of this do you have working?
is this part working?:"So the grid view basically gets populated as the user is selecting items from the ddl and clicking the button."

I would use a datatable to maintain the gridview and user interaction...then work with the datatable when it's time to insert into the db...


http://msdn2.microsoft.com/en-us/library/system.data.datatable(vs.71).aspx
0
 

Author Comment

by:Prysson
ID: 18861781
My problem right now is basically trying to figure out how to bind an item template text property to a column in the datatable
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 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