help:Delete data from database

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?
 
M

Miha Markic [MVP C#]

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.
 
G

Guest

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
 

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

Top