none
Update en dataset RRS feed

  • Pregunta

  • estoy actualizando por medio de tableadapter en dataset el código que pegue arriba es el del botón de la ejecución de dicha instrucción update (MODIFICAR)....

    Public Class Form1
    
        Private Sub LISTABindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles LISTABindingNavigatorSaveItem.Click
            Me.Validate()
            Me.LISTABindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.Base1DataSet)
    
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'TODO: esta línea de código carga datos en la tabla 'Base1DataSet.LISTA' Puede moverla o quitarla según sea necesario.
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
    
        End Sub
    
        Private Sub PROTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub MANTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub BAUTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub MADTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub PERISTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub FECHADateTimePicker_ValueChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub IDTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub NOMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub DIMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub PESTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub LONTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub SUPTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub CORTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub KAMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
            Form2.Show()
        End Sub
    
        Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            Me.Close()
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.LISTATableAdapter.INSERTAR(IDTextBox.Text, NOMTextBox.Text, DIMTextBox.Text, PESTextBox.Text, LONTextBox.Text, SUPTextBox.Text, CORTextBox.Text, KAMTextBox.Text, PROTextBox.Text, MANTextBox.Text, BAUTextBox.Text, MADTextBox.Text, PERISTextBox.Text, FECHADateTimePicker.Text)
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
        End Sub
    
        Private Sub LISTADataGridView_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
    
        End Sub
    
        Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            Dim loFila As DataGridViewRow = Me.LISTADataGridView.CurrentRow()
            LISTADataGridView.Rows.Remove(loFila)
        End Sub
    
        Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
            Me.LISTATableAdapter.FillBy(Me.Base1DataSet.LISTA, NOMTextBox.Text)
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.LISTATableAdapter.MODIFICAR(IDTextBox.Text, NOMTextBox.Text, DIMTextBox.Text, PESTextBox.Text, LONTextBox.Text, SUPTextBox.Text, CORTextBox.Text, KAMTextBox.Text, PROTextBox.Text, MANTextBox.Text, BAUTextBox.Text, MADTextBox.Text, PERISTextBox.Text, FECHADateTimePicker.Text, NOMTextBox.Text)
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
        End Sub
    End Class





    AYUDENME POR FAVOR... MUCHAS GRACIAS

    sábado, 14 de enero de 2017 20:06

Todas las respuestas

  • estoy actualizando por medio de listatableadapter en base1dataset el código que pegue arriba es el del botón de la ejecución de dicha instrucción update (MODIFICAR)....

    Public Class Form1
    
        Private Sub LISTABindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles LISTABindingNavigatorSaveItem.Click
            Me.Validate()
            Me.LISTABindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.Base1DataSet)
    
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            'TODO: esta línea de código carga datos en la tabla 'Base1DataSet.LISTA' Puede moverla o quitarla según sea necesario.
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
    
        End Sub
    
        Private Sub PROTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub MANTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub BAUTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub MADTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub PERISTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub FECHADateTimePicker_ValueChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub IDTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub NOMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub DIMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub PESTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub LONTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub SUPTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub CORTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub KAMTextBox_TextChanged(sender As Object, e As EventArgs)
    
        End Sub
    
        Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
            Form2.Show()
        End Sub
    
        Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            Me.Close()
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.LISTATableAdapter.INSERTAR(IDTextBox.Text, NOMTextBox.Text, DIMTextBox.Text, PESTextBox.Text, LONTextBox.Text, SUPTextBox.Text, CORTextBox.Text, KAMTextBox.Text, PROTextBox.Text, MANTextBox.Text, BAUTextBox.Text, MADTextBox.Text, PERISTextBox.Text, FECHADateTimePicker.Text)
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
        End Sub
    
        Private Sub LISTADataGridView_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)
    
        End Sub
    
        Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            Dim loFila As DataGridViewRow = Me.LISTADataGridView.CurrentRow()
            LISTADataGridView.Rows.Remove(loFila)
        End Sub
    
        Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
            Me.LISTATableAdapter.FillBy(Me.Base1DataSet.LISTA, NOMTextBox.Text)
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.LISTATableAdapter.MODIFICAR(IDTextBox.Text, NOMTextBox.Text, DIMTextBox.Text, PESTextBox.Text, LONTextBox.Text, SUPTextBox.Text, CORTextBox.Text, KAMTextBox.Text, PROTextBox.Text, MANTextBox.Text, BAUTextBox.Text, MADTextBox.Text, PERISTextBox.Text, FECHADateTimePicker.Text, NOMTextBox.Text)
            Me.LISTATableAdapter.Fill(Me.Base1DataSet.LISTA)
        End Sub
    End Class


    codigo completo:



    AYUDENME POR FAVOR... MUCHAS GRACIAS

    sábado, 14 de enero de 2017 8:40
  • estoy actualizando por medio de tableadapter en dataset coloque un boton MODIFICAR en un form STOCK en donde deberia modificar en el datagridview del blindingSource solo el campo de la columna EXISTENTES .... cosa que no pasa.... me modifca los datos de las columnas de forma aleatoria... no seque pasa

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.LISTATableAdapter.MODIFICAR(NOMTextBox.Text, DITextBox.Text, PESTextBox.Text, LONTextBox.Text, EXISTENTESTextBox.Text, NOMTextBox.Text)
            Me.LISTATableAdapter.Fill(Me.STOCKDataSet.LISTA)
        End Sub

    domingo, 15 de enero de 2017 10:53
  • Hola, ¿esta pregunta es la misma que esta otra?

    https://social.msdn.microsoft.com/Forums/es-ES/02d6c47e-976b-41b5-92ff-f9836cfbb965/actualizar-datos-update-en-dataset?forum=vbes

    según tus pantallas veo que actualiza todas las filas en las que el NOMBRE es "ANGULO" lo cual está bien según la sentencia que mandas en el tableAdapter, las filas que no se modifican son las que dicen Ángulo, nótese la tilde en la A y eso también esta bien ,si quieres que solo se actualice una fila debería actualizar por ID


    Si la respuesta te fue útil vótala como tal,y si fue respuesta márcala. Solo dejo en el foro mis post si fueron útiles , de lo contrario y por mantener el orden los borro. Saludos. Lima-Perú.



    • Editado Augusto1982 domingo, 15 de enero de 2017 23:43
    domingo, 15 de enero de 2017 23:41