la cosa es que quiero ahora que cuando le de al boton eleminar borre los registros que estan seleccionados con el checkbox
Pero de la foma que lo estoy haciendo, pues parece que reconec cual esta seleccionado pero no elimina el registro
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Gracias de antemano
El codigo que estoy usando es este
Sub ShowSelections(sender As System.Object, e As System.EventArgs)
Dim dgItem As DataGridItem
Dim chkSelected As CheckBox
Dim strCustomerID As String
Dim BxsChkd As Boolean = False
Dim MyCommand As SqlCommand
'lblSelections.Text = "<br>Fooled Ya! The following rows were marked for deletion, "
'lblSelections.Text += "but not actually deleted:<br><br>"
For Each dgItem in MyDataGrid.Items
chkSelected = dgItem.FindControl("chkSelection")
If chkSelected.Checked Then
strCustomerID = CType(dgItem.FindControl("lblCustomerId"), Label).Text
'lblSelections.Text += "Customer ID: <b>" & strCustomerID & "</b><br>"
Dim deleteSQL As String = "DELETE from SolicitudEmpleo WHERE SolicitudID ="+ strCustomerID
MyCommand = New SqlCommand(deleteSQL, MyConnection)
end if
If BxsChkd = True Then
Try
MyCommand.ExecuteNonQuery()
OutputMsg.InnerHtml += "<font size=4><b>Store information has been deleted.</b></font>"
OutputMsg.Style("color") = "green"
Catch err As SqlException
OutputMsg.InnerHtml += err.Message.ToString
OutputMsg.Style("color") = "red"
End Try
bingrid (SelectCommand)
End If
Next
End Sub