Metodos de eliminacion
Private Sub eliminarclienteBD(ByVal pnombres As String, ByVal papellidos As String, _ ByVal pDireccion As String, ByVal pdni As String) Dim myStoreBD As New StoreBD() Try Dim queryCliente As IQueryable(Of Cliente) = From c In myStoreBD.Cliente Where c.Dni = pdni Select c Dim updateCliente As Cliente = queryCliente.FirstOrDefault 'actualizamos el registro updateCliente.Nombre = pnombres updateCliente.Apellidos = papellidos updateCliente.Direccion = pDireccion myStoreBD.SubmitChanges() Catch ex As Exception Finally End Try End Sub
Private Sub eliminarclienteBD(ByVal pdni As String) Dim myStoreBD As New StoreBD() Try Dim queryCliente As IQueryable(Of Cliente) = From c In myStoreBD.Cliente Where c.Dni = pdni Select c Dim deleteCliente As Cliente = queryCliente.FirstOrDefault 'eliminamos el registro de la tabla myStoreBD.Cliente.DeleteOnSubmit(deleteCliente) myStoreBD.SubmitChanges() Catch ex As Exception Finally End Try End Sub
Comentarios
Publicar un comentario