How to delete all?

Nov 5, 2009 at 7:49 PM

anybody how to use delete all?

IseitzProductTempCollection.


thanks john 

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

CustomerCollection.DeleteData(x=>true);

Using this mechanism you can vary the where clause

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

Coordinator
Dec 4, 2009 at 3:18 AM

There is a training video on YouTube addressing aggregates. http://www.youtube.com/watch?v=UGXImHM3ksg