This project is read-only.

How to delete all?

Nov 5, 2009 at 7:49 PM

anybody how to use delete all?


thanks john 

Nov 6, 2009 at 12:53 PM

You can load a collection and use the "Clear" method. This is a bad idea since it loads all data just to remove it. The best way is to use LINQ. The following sho how to delete all items from the Customer collection.


Using this mechanism you can vary the where clause

CustomerCollection.DeleteData(x=>x.CustomerId == 3);
CustomerCollection.DeleteData(x=>x.Email == "" && x.LastName == "Smith");

Dec 4, 2009 at 3:18 AM

There is a training video on YouTube addressing aggregates.