B
Brad Pears
I am working on a new vb.net 2005 project using SQL server 2000 as the
backend db.
I have a listview where control I want a user to be able to select either
just one or multiple rows in the listview and perform an action on them. If
the user chooses to delete these rows I wonder what the best way to handle
the deletion of multiple rows is...
Right now I have a stored procedure for deleteing jsut opne row. i.e delete
from {tablename} where field1 = Parm1". However, if the user selects say 10
rows, should I loop through the lsitview items and call this SP each time,
OR can I somehow batch them so that I can run the stored procedure just
once - which would then delete all selected rows using a clause similiar to
the following.... "delete from {tablename} where field1 in (select field1
from{tempdeleteditemstable})"
Any ideas if this is the best way to do it - or is simply looping through
the listview and calling the stored proc to do a single row delete each time
ok? They would never be deleting that many items at once - but definately
there may be times when multiple deletes will be required...
Thanks, Brad
backend db.
I have a listview where control I want a user to be able to select either
just one or multiple rows in the listview and perform an action on them. If
the user chooses to delete these rows I wonder what the best way to handle
the deletion of multiple rows is...
Right now I have a stored procedure for deleteing jsut opne row. i.e delete
from {tablename} where field1 = Parm1". However, if the user selects say 10
rows, should I loop through the lsitview items and call this SP each time,
OR can I somehow batch them so that I can run the stored procedure just
once - which would then delete all selected rows using a clause similiar to
the following.... "delete from {tablename} where field1 in (select field1
from{tempdeleteditemstable})"
Any ideas if this is the best way to do it - or is simply looping through
the listview and calling the stored proc to do a single row delete each time
ok? They would never be deleting that many items at once - but definately
there may be times when multiple deletes will be required...
Thanks, Brad