|
For i = 0 To Me.DataGrid1.Items.Count-1
Dim ck As CheckBox
ck = CType (DataGrid1.Items (i) .Cells (0) .FindControl ("CheckBox_delete"), CheckBox)
If ck.Checked = True Then
Dim cmd As SqlCommand
Dim p1 As SqlParameter
cmd = New SqlCommand ("Article_Delete", conn)
cmd.CommandType = CommandType.StoredProcedure
p1 = cmd.Parameters.Add ("@ ArticleId", SqlDbType.Int)
p1.Value = DataGrid1.Items (i) .Cells (6) .Text
cmd.ExecuteNonQuery ()
End If
Next |
|