Disconnected data updates with datagrid - approach question

M

Matt

I have a datagrid that presents some detail records for each employee. I
am required to allow the user to work on the detail records (edit,
update, add) in the datagrid but not commit the changes to the database
until a submit button is pressed, which triggers some data edits. This
must be done because the detail records cannot be edited until they are
all present (some columns need to total 100%).

My approach is listed below. I would like to hear any advice on my
approach, specifically if there is anything that could be done to make
it more efficent. I have users that have poor connections to the website
and minimizing trips to the server is encouraged.

1) Define dataset object and load data from database into the objects.
2) Load the datagrid objects with the datasets.
3) Save the table to a session variable (dataset.tables(0)) for each
dataset / datagrid.
4) On update/insert for a datagrid:
a) load a table object from the saved table in session
b) using a dataview and datarow object, perform changes to the
datatable (don't think detail is necessary here)
c) save the changed datatable to session
d) bind the grid to the new session datatable
5) When the submit button is pressed
a) retrieve the datatable object for the grid from session
b) loop thru the datatable and perform edits
c) if no errors, use sql to update the database and rebind the grid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top