Groups | Blog | Home
all groups > dotnet general > november 2003 >

dotnet general : How to Delete a row from dataset ??



Imayakumar
11/30/2003 7:07:45 PM
Hi ,
i fetched some records from SQL Server using data adapter
and filled it to the dataset. now i want to add some rows
to the dataset and reflect it to the database.. i can do
it perfectly with no problem. but when i try to delete
some rows from the dataset, it gives error..
can any one help how to do this ??
Thanks.
soni_ace NO[at]SPAM hotmail.com
12/1/2003 1:54:09 AM
Jagan Mohan
12/1/2003 12:41:50 PM
Deleting DataRow

DataRow[] drDelRows = ds.Tables[0].Select("DELSTATUS = 1");
foreach(DataRow drRow in drDelRows)
{
ds.Tables[0].DeleteRow(drRow);
}

This should work. Can you also give me the details of the error you are
getting.

Thanks,
Jagan Mohan

[quoted text, click to view]

AddThis Social Bookmark Button