all groups > asp.net webcontrols > december 2006 >
You're in the

asp.net webcontrols

group:

GridView with changes transferred to db at end-of-edit


GridView with changes transferred to db at end-of-edit R.A.M.
12/20/2006 10:43:59 PM
asp.net webcontrols:
Hi,
I am learning ASP.NET and I need to have an Excel-like sheet of records from
database. Users may modify data in the sheet. I thought about using GridView
with DataSource but the problem is that the changes should be transferred to
database not when record is modified but when separate button is clicked
(then a transaction with inserts/updates/deletes should be performed). As I
understand database commands of DataSource are executed when records are
modified.
Do you know any good ideas? I think about storing (using DataSource
commands) changes in temporal table and then transferring changes to main
database table when button is pressed, but I don't know if it's a good
solution because implementation will be rather complicated as I guess.
/RAM/

Re: GridView with changes transferred to db at end-of-edit R.A.M.
12/20/2006 11:21:59 PM
What do you think about this:

In InsertCommand I insert into temporal table #i
in UpdateCommand I insert into temporal table #u
in DeleteCommand I insert into temportal table #d
in SelectCommand I select from main table t and temporal tables:
( select * from t
union
select * from #i
except
select * from #d
union
select * from #u )
except
( select key from t
intersect
select key from #u ) .
On button click I transfer from temporal tables to main table t.

U¿ytkownik "R.A.M." <r_ahimsa_m@poczta.onet.pl> napisa³ w wiadomo¶ci
news:emcar0$tja$2@news.onet.pl...
[quoted text, click to view]

AddThis Social Bookmark Button