help:Delete data from database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a dataset and 3 tables with it,and i create primarykey and relation for them
i bind it to a third party datagrid
it looks like a treeview,some rows expanded,and some rows collapsed
and then i modify,delete,add data from database
when i use dataadapter.fill(dataset,"tablename") this metho
the table was refreshed only modified and new data,but the data i deleted from databse is still in table
i don't want to use table.clear this method,because it'll redraw my grid
is there any method to cover this?
 
Hi pighead,

You might load data in secondary dataset.
Compare which rows are missing.
Delete rows from original dataset that are missing.
Do a Merge.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

pighead said:
i have a dataset and 3 tables with it,and i create primarykey and relation for them.
i bind it to a third party datagrid.
it looks like a treeview,some rows expanded,and some rows collapsed.
and then i modify,delete,add data from database.
when i use dataadapter.fill(dataset,"tablename") this method
the table was refreshed only modified and new data,but the data i deleted
from databse is still in table.
 
dear Miha Markic
thanks for your help
Wen the table is large,it waste time to compare each key
if this is the final way i need to do ,i'll do it

thanks again
 
Back
Top