?
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
Medium Priority
?
279 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 1000 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

Industry Leaders: 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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

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