08-10-20, 10:07 PM
كود :
If MsgBox(" هل تريد بالفعل حذف السجل المحدد ؟" & "" & vbCrLf & vbCrLf & "", vbExclamation + vbYesNo, tit) = vbNo Then
Exit Sub
Else
Con.Open()
Dim SavInto As New SqlCommand
SavInto.Connection = Con
SavInto.CommandType = CommandType.Text
SavInto.CommandText = "dalete from tap_name WHERE id=" & Val(DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(0).Value) & " "
SavInto.ExecuteNonQuery()
Con.Close()
End If