it doesn't mean that the dataset need to direct update the database value, i'm talking about the UI level - the grid view.how to implement a cascade update for detail.master_id ?
ok, maybe we start again, following the new table structure:
Code: Select all
master table (
id varchar(50) primary key,
name varchar(50)
);
detail table (
id varchar(50) primary key,
master_id varchar(50),
name varchar(50),
FOREIGN KEY (master_id) REFERENCES master (id) ON DELETE RESTRICT ON UPDATE CASCADE,
);
1. insert a record on master grid, like id = 'A'
2. insert two record on detail grid, like id = 'A1', master_id = 'A' & id = 'A2', master_id = 'A'
3. update master grid id from 'A' to 'B'
4. ** important ** 'A1' & 'A2' records in detail grid are disappeared
so, my problem is how to maintain detail grid keep displaying 'A1' & 'A2' records when master key changed?
thanks!