Bonjour
j'ai deux tables (STOCK,ENTREE) dans la table STOCk il y a une colonne qui s'appelle ( QTE ACTUEL) ensuite il y a une autre dans la table ENTREE nommée (QTE ENTREE) . mon probleme reside dans la mise à jour de STOCK lorsque j'ajoute une ligne dans ENTREE je veux que (QTE ENTREE) s'ajoute à (QTE ACTUEL) dans STOCK
voilà ce que j'ai essayé mais c'etait en vain :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If CODE_BRTextBox.Text = "" Or NOM_FOURNISSEURTextBox1.Text = "" Or QTE_ENTREETextBox.Text = "" Then
            MsgBox("veuillez saisir tous les informations", MsgBoxStyle.Exclamation, "Attention")
        Else
            Me.ENTREETableAdapter.Insert(ARTICLETextBox.Text, DESIGNATIONTextBox.Text, REF_INTERNETextBox.Text, NOM_FOURNISSEURTextBox1.Text, DATE_ENTREEDateTimePicker.Text, CODE_BRTextBox.Text, QTE_ENTREETextBox.Text)
            ' Me.STOCKTableAdapter .Update (
            inc = 1 'inc.Equals(Form2.STOCKDataGridView.SelectedRows)
            Dim cb As New OleDb.OleDbCommandBuilder(da)
            ds.Tables("STOCK").Rows(inc).Item(0) = IDTextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(1) = ARTICLETextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(2) = DESIGNATIONTextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(3) = REF_INTERNETextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(4) = QTE_ACTUELTextBox.Text + QTE_ENTREETextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(5) = QTE_DE_SECURITETextBox.Text
            ds.Tables("STOCK").Rows(inc).Item(6) = NOM_FOURNISSEURTextBox.Text
            Me.da.Update(ds, "STOCK")
            MsgBox("Le nouveau Article est bien ajouté au magasin")
 
            'Dim maligne As DataRow
 
            'For each maligne As r
            'maligne = Form2.STOCKDataGridView.RowCount - 1
            'Form2.STOCKDataGridView.Rows(maligne).Cells(4).Value = QTE_ACTUELTextBox.Text + QTE_ENTREETextBox.Text
            Form2.STOCKBindingSource.EndEdit()
            Me.ENTREETableAdapter.Fill(Me._prodec_1DataSet.ENTREE)
            Me.STOCKTableAdapter.Fill(Me._prodec_1DataSet.STOCK)
            MsgBox("Bien ajouté", MsgBoxStyle.Information, "Ajouté")
            vider()
        End If
 
    End Sub
mon objectif se resume dans cette ligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
ds.Tables("STOCK").Rows(inc).Item(4) = QTE_ACTUELTextBox.Text + QTE_ENTREETextBox.Text
n'hesitez pas de m'aider svp même de chouia