Geeks With Blogs
Saif Khan { I am Saif } "Knowledge is power, information is free, share it!"

 

I was looking for a way to delete many objects (selected in a GridView) in one query instead of iterating each ActiveRecord and executing the .Destroy(). I tried the following but it didn’t work

myActiveRecordCollection().BatchDelete()

I used this instead

Dim items As New ArrayList() 
 
For Each Item Selected in the GridView 
 
    items.Add(the id of the record I want to delete)
 
Next
 
Dim query As New SubSonic.Query(Table.Schema) 
query.QueryType = SubSonic.QueryType.Delete 
query.IN("ColumnName", list) 
query.Execute()

 

Posted on Friday, April 29, 2011 7:32 AM | Back to top


Comments on this post: SubSonic 2.2 Multiple Deletes

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © saifkhan | Powered by: GeeksWithBlogs.net