Does this help you :
http://www.aspsnippets.com/Articles/Select-and-delete-multiple-rows-in-ASP.Net-Gridview-control.aspx[
^]
Specially
Deleting multiple selected rows section
and this one :
http://geekswithblogs.net/dotNETvinz/archive/2009/02/22/gridview-multiple-delete-with-checkbox-and-confirm.aspx[
^]
[EDIT]
After your comment I should say that you need to concatenate selected IDs at the application side and send them to a stored procedure. In the stored procedure you need to split received IDs by knowing the delimiter character and make a list of IDs so I have provided for you the code for the spliter :
declare @sep char(1)
declare @s varchar(max)
set @sep = ','
set @s= '16,17,18';
WITH Pieces(pn, start, stop) AS (
SELECT 1, cast(1 as int), CHARINDEX(@sep, @s)
UNION ALL
SELECT pn + 1, cast(stop + 1 as int), CHARINDEX(@sep, @s, stop + 1)
FROM Pieces
WHERE stop > 0
),shouldDelete(id) as
(
SELECT
SUBSTRING(@s, start, CASE WHEN stop > 0 THEN stop-start ELSE LEN(@s) END) AS s
FROM Pieces
)
delete from TableName where id in (select * from shouldDelete)
I have extracted splitter part from here :
http://stackoverflow.com/questions/314824/t-sql-opposite-to-string-concatenation-how-to-split-string-into-multiple-reco[
^]
16 , 17 and 18 are examples so convert @s to the parameter of stored procedure.
And remember that you have a limit of 8000 characters in case of using
varchar
for parameter type.
I'm sure you can handle rest of the work ;)
Good Luck