|
想请问下各位大大,要怎么用datagrid update database 呢?
普通的从datagrid拿data然后insert进database我做到。。我是写在button click event里
可是我想在一个row lost focus后,system就会自己update那个row的record ...
datagrid里有没有酱的event呢?
然后如果我要update sales transaction table里几个row的record(已save进sales transaction table,product table的quantity 已扣掉了),假设原本有5个record
ID name quantity
------ ---------- -----------
1 honda 20
2 proton 20
3 hyundai 30
4 toyota 30
5 Benz 50
update后的transaction record:
ID name quantity
------ ---------- -----------
2 proton 10
3 hyundai 20
5 Benz 50
假设我是先delete旧的5个record再insert新的3个record,有没有办法拿回已deleted的2个record的quantity来update product table(加回product里的quantity)呢?
请各位大大帮帮忙,谢谢 |
|