C# Delete only filtered rows from DataView??

Started by
1 comment, last by faculaganymede 17 years ago
C# Gurus, Is there an easy way to delete only filtered rows from a DataView table? This is how I set up my DataView object: DataView m_dv = new DataView(tbl.Tables[0]); m_dv.RowFilter = "ID="+id.ToString(); ==> here I want to delete all the rows that match the id string. Thanks.
Advertisement
Try:

for (int i = m_dv.Count-1; i >= 0 ; i--) m_dv.Delete(i);
-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-Senior Programmer - iMAX Games
Thanks HeavyStorm. I thought I tried something like that before and didn't work, but may be I didn't set it up correctly. It works now :)

This topic is closed to new replies.

Advertisement