Mise a jour de base de donnée .net [Résolu]

Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
- - Dernière réponse : thetoto52
Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
- 7 avril 2006 à 11:08
Voila j'utilise un Binding Manager Base et la base de donnée n'est pas mise a jours quelqu'un peut me dire comment je peut faire.
Merci d'avance
Afficher la suite 

9 réponses

Meilleure réponse
Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
3
Merci
Bonne nouvelle a force de percévérence et avec un peut d'aide j'ai fini par y arriver.

Voici le code


Imports System.Data.OleDb

Public Class Form3
Inherits System.Windows.Forms.Form

Public sql As String
Public macommande As OleDbCommandBuilder
Public WithEvents adapt As OleDb.OleDbDataAdapter
Public dset As New DataSet
Public bmb As BindingManagerBase

#Region " Code généré par le Concepteur Windows Form "

Public Sub New()
MyBase.New()

'Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()

'Ajoutez une initialisation quelconque après l'appel InitializeComponent()

End Sub

'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Requis par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer

'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée en utilisant le Concepteur Windows Form.
'Ne la modifiez pas en utilisant l'éditeur de code.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents Button8 As System.Windows.Forms.Button
Friend WithEvents Button9 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.TextBox6 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Button5 = New System.Windows.Forms.Button
Me.Button6 = New System.Windows.Forms.Button
Me.Button7 = New System.Windows.Forms.Button
Me.Button8 = New System.Windows.Forms.Button
Me.Button9 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(88, 24)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Code"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 56)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(88, 24)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Nom"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(88, 24)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Adresse"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(8, 104)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(88, 24)
Me.Label4.TabIndex = 3
Me.Label4.Text = "CP"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(8, 128)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(88, 24)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Ville"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(8, 152)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(88, 24)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Tel"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(96, 32)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(184, 20)
Me.TextBox1.TabIndex = 6
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(96, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(184, 20)
Me.TextBox2.TabIndex = 7
Me.TextBox2.Text = ""
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(96, 80)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(184, 20)
Me.TextBox3.TabIndex = 8
Me.TextBox3.Text = ""
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(96, 104)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(184, 20)
Me.TextBox4.TabIndex = 9
Me.TextBox4.Text = ""
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(96, 128)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(184, 20)
Me.TextBox5.TabIndex = 10
Me.TextBox5.Text = ""
'
'TextBox6
'
Me.TextBox6.Location = New System.Drawing.Point(96, 152)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(184, 20)
Me.TextBox6.TabIndex = 11
Me.TextBox6.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(296, 128)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(88, 24)
Me.Button1.TabIndex = 12
Me.Button1.Text = "Annuler"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(296, 96)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(88, 24)
Me.Button2.TabIndex = 13
Me.Button2.Text = "Valider"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(296, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(88, 24)
Me.Button3.TabIndex = 14
Me.Button3.Text = "Quitter"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(296, 192)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(88, 23)
Me.Button4.TabIndex = 18
Me.Button4.Text = "Dernier"
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(8, 192)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(88, 23)
Me.Button5.TabIndex = 17
Me.Button5.Text = "Premier"
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(200, 192)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(88, 23)
Me.Button6.TabIndex = 16
Me.Button6.Text = "Suivant"
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(104, 192)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(88, 23)
Me.Button7.TabIndex = 15
Me.Button7.Text = "Précédent"
'
'Button8
'
Me.Button8.Location = New System.Drawing.Point(296, 64)
Me.Button8.Name = "Button8"
Me.Button8.Size = New System.Drawing.Size(88, 24)
Me.Button8.TabIndex = 20
Me.Button8.Text = "Suprimer"
'
'Button9
'
Me.Button9.Location = New System.Drawing.Point(296, 32)
Me.Button9.Name = "Button9"
Me.Button9.Size = New System.Drawing.Size(88, 24)
Me.Button9.TabIndex = 19
Me.Button9.Text = "Ajouter"
'
'Form3
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(392, 222)
Me.Controls.Add(Me.Button8)
Me.Controls.Add(Me.Button9)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.Button7)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form3"
Me.Text = "Form3"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sql = "select * from Client"
adapt = New OleDb.OleDbDataAdapter(sql, connec)
'adapt.SelectCommand = macommande
adapt.Fill(dset, "Client")
macommande = New OleDbCommandBuilder(adapt)
affiche()
'bmb = Me.BindingContext(dset, "client")
bmb = BindingContext(dset, "Client")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bmb.EndCurrentEdit()
Button5.Enabled() = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
Button4.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button9.Enabled() = True
'adapt.Update(dset, "Client")
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
bmb.Position = bmb.Count - 1
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Try
'adapt.Update(dset, "Client")
'Catch ex As Exception
'MessageBox.Show(ex.Message)
'End Try
Me.Close()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
bmb.Position = 0
End Sub
Private Sub affiche()
TextBox1.DataBindings.Add("text", dset, "Client.Codeclient")
TextBox2.DataBindings.Add("text", dset, "Client.Nomclient")
TextBox3.DataBindings.Add("text", dset, "Client.Adresseclient")
TextBox4.DataBindings.Add("text", dset, "Client.CPclient")
TextBox5.DataBindings.Add("text", dset, "Client.Villeclient")
TextBox6.DataBindings.Add("text", dset, "Client.Telclient")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
bmb.Position -= 1
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
'adapt.Update(dset, "Client")
bmb.Position = bmb.Position + 1
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
bmb.AddNew()
Button9.Enabled = False
Button8.Enabled = False
Button3.Enabled = False
Button5.Enabled = False
Button7.Enabled = False
Button6.Enabled = False
Button4.Enabled = False
'Button1.Enabled() = True
'Button2.Enabled() = True
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
bmb.RemoveAt(bmb.Position)
Button5.Enabled() = True
Button9.Enabled() = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button9.Enabled = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button4.Enabled = True
bmb.CancelCurrentEdit()
End Sub

Private Sub Form3_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
adapt.Update(dset, "Client")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Dire « Merci » 3

Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire

Codes Sources 195 internautes nous ont dit merci ce mois-ci

Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
3
Merci
Bonne nouvelle a force de percévérence et avec un peut d'aide j'ai fini par y arriver.

Voici le code :

Imports System.Data.OleDb

Public Class Form3
Inherits System.Windows.Forms.Form

Public sql As String
Public macommande As OleDbCommandBuilder
Public WithEvents adapt As OleDb.OleDbDataAdapter
Public dset As New DataSet
Public bmb As BindingManagerBase

#Region " Code généré par le Concepteur Windows Form "

Public Sub New()
MyBase.New()

'Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()

'Ajoutez une initialisation quelconque après l'appel InitializeComponent()

End Sub

'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Requis par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer

'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée en utilisant le Concepteur Windows Form.
'Ne la modifiez pas en utilisant l'éditeur de code.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents Button8 As System.Windows.Forms.Button
Friend WithEvents Button9 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.TextBox6 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Button5 = New System.Windows.Forms.Button
Me.Button6 = New System.Windows.Forms.Button
Me.Button7 = New System.Windows.Forms.Button
Me.Button8 = New System.Windows.Forms.Button
Me.Button9 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(88, 24)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Code"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 56)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(88, 24)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Nom"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(88, 24)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Adresse"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(8, 104)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(88, 24)
Me.Label4.TabIndex = 3
Me.Label4.Text = "CP"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(8, 128)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(88, 24)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Ville"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(8, 152)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(88, 24)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Tel"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(96, 32)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(184, 20)
Me.TextBox1.TabIndex = 6
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(96, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(184, 20)
Me.TextBox2.TabIndex = 7
Me.TextBox2.Text = ""
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(96, 80)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(184, 20)
Me.TextBox3.TabIndex = 8
Me.TextBox3.Text = ""
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(96, 104)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(184, 20)
Me.TextBox4.TabIndex = 9
Me.TextBox4.Text = ""
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(96, 128)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(184, 20)
Me.TextBox5.TabIndex = 10
Me.TextBox5.Text = ""
'
'TextBox6
'
Me.TextBox6.Location = New System.Drawing.Point(96, 152)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(184, 20)
Me.TextBox6.TabIndex = 11
Me.TextBox6.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(296, 128)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(88, 24)
Me.Button1.TabIndex = 12
Me.Button1.Text = "Annuler"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(296, 96)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(88, 24)
Me.Button2.TabIndex = 13
Me.Button2.Text = "Valider"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(296, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(88, 24)
Me.Button3.TabIndex = 14
Me.Button3.Text = "Quitter"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(296, 192)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(88, 23)
Me.Button4.TabIndex = 18
Me.Button4.Text = "Dernier"
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(8, 192)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(88, 23)
Me.Button5.TabIndex = 17
Me.Button5.Text = "Premier"
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(200, 192)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(88, 23)
Me.Button6.TabIndex = 16
Me.Button6.Text = "Suivant"
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(104, 192)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(88, 23)
Me.Button7.TabIndex = 15
Me.Button7.Text = "Précédent"
'
'Button8
'
Me.Button8.Location = New System.Drawing.Point(296, 64)
Me.Button8.Name = "Button8"
Me.Button8.Size = New System.Drawing.Size(88, 24)
Me.Button8.TabIndex = 20
Me.Button8.Text = "Suprimer"
'
'Button9
'
Me.Button9.Location = New System.Drawing.Point(296, 32)
Me.Button9.Name = "Button9"
Me.Button9.Size = New System.Drawing.Size(88, 24)
Me.Button9.TabIndex = 19
Me.Button9.Text = "Ajouter"
'
'Form3
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(392, 222)
Me.Controls.Add(Me.Button8)
Me.Controls.Add(Me.Button9)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.Button7)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form3"
Me.Text = "Form3"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sql = "select * from Client"
adapt = New OleDb.OleDbDataAdapter(sql, connec)
'adapt.SelectCommand = macommande
adapt.Fill(dset, "Client")
macommande = New OleDbCommandBuilder(adapt)
affiche()
'bmb = Me.BindingContext(dset, "client")
bmb = BindingContext(dset, "Client")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bmb.EndCurrentEdit()
Button5.Enabled() = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
Button4.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button9.Enabled() = True
'adapt.Update(dset, "Client")
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
bmb.Position = bmb.Count - 1
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Try
'adapt.Update(dset, "Client")
'Catch ex As Exception
'MessageBox.Show(ex.Message)
'End Try
Me.Close()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
bmb.Position = 0
End Sub
Private Sub affiche()
TextBox1.DataBindings.Add("text", dset, "Client.Codeclient")
TextBox2.DataBindings.Add("text", dset, "Client.Nomclient")
TextBox3.DataBindings.Add("text", dset, "Client.Adresseclient")
TextBox4.DataBindings.Add("text", dset, "Client.CPclient")
TextBox5.DataBindings.Add("text", dset, "Client.Villeclient")
TextBox6.DataBindings.Add("text", dset, "Client.Telclient")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
bmb.Position -= 1
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
'adapt.Update(dset, "Client")
bmb.Position = bmb.Position + 1
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
bmb.AddNew()
Button9.Enabled = False
Button8.Enabled = False
Button3.Enabled = False
Button5.Enabled = False
Button7.Enabled = False
Button6.Enabled = False
Button4.Enabled = False
'Button1.Enabled() = True
'Button2.Enabled() = True
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
bmb.RemoveAt(bmb.Position)
Button5.Enabled() = True
Button9.Enabled() = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button9.Enabled = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button4.Enabled = True
bmb.CancelCurrentEdit()
End Sub

Private Sub Form3_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
adapt.Update(dset, "Client")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Dire « Merci » 3

Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire

Codes Sources 195 internautes nous ont dit merci ce mois-ci

Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
3
Merci
Bonne nouvelle a force de percévérence et avec un peut d'aide j'ai fini par y arriver.

Voici le code :

Imports System.Data.OleDb

Public Class Form3
Inherits System.Windows.Forms.Form

Public sql As String
Public macommande As OleDbCommandBuilder
Public WithEvents adapt As OleDb.OleDbDataAdapter
Public dset As New DataSet
Public bmb As BindingManagerBase

#Region " Code généré par le Concepteur Windows Form "

Public Sub New()
MyBase.New()

'Cet appel est requis par le Concepteur Windows Form.
InitializeComponent()

'Ajoutez une initialisation quelconque après l'appel InitializeComponent()

End Sub

'La méthode substituée Dispose du formulaire pour nettoyer la liste des composants.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Requis par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer

'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée en utilisant le Concepteur Windows Form.
'Ne la modifiez pas en utilisant l'éditeur de code.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents Button8 As System.Windows.Forms.Button
Friend WithEvents Button9 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.TextBox5 = New System.Windows.Forms.TextBox
Me.TextBox6 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Button5 = New System.Windows.Forms.Button
Me.Button6 = New System.Windows.Forms.Button
Me.Button7 = New System.Windows.Forms.Button
Me.Button8 = New System.Windows.Forms.Button
Me.Button9 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(88, 24)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Code"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(8, 56)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(88, 24)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Nom"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(88, 24)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Adresse"
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(8, 104)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(88, 24)
Me.Label4.TabIndex = 3
Me.Label4.Text = "CP"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(8, 128)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(88, 24)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Ville"
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(8, 152)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(88, 24)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Tel"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(96, 32)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(184, 20)
Me.TextBox1.TabIndex = 6
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(96, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(184, 20)
Me.TextBox2.TabIndex = 7
Me.TextBox2.Text = ""
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(96, 80)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(184, 20)
Me.TextBox3.TabIndex = 8
Me.TextBox3.Text = ""
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(96, 104)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(184, 20)
Me.TextBox4.TabIndex = 9
Me.TextBox4.Text = ""
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(96, 128)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(184, 20)
Me.TextBox5.TabIndex = 10
Me.TextBox5.Text = ""
'
'TextBox6
'
Me.TextBox6.Location = New System.Drawing.Point(96, 152)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(184, 20)
Me.TextBox6.TabIndex = 11
Me.TextBox6.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(296, 128)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(88, 24)
Me.Button1.TabIndex = 12
Me.Button1.Text = "Annuler"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(296, 96)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(88, 24)
Me.Button2.TabIndex = 13
Me.Button2.Text = "Valider"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(296, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(88, 24)
Me.Button3.TabIndex = 14
Me.Button3.Text = "Quitter"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(296, 192)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(88, 23)
Me.Button4.TabIndex = 18
Me.Button4.Text = "Dernier"
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(8, 192)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(88, 23)
Me.Button5.TabIndex = 17
Me.Button5.Text = "Premier"
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(200, 192)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(88, 23)
Me.Button6.TabIndex = 16
Me.Button6.Text = "Suivant"
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(104, 192)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(88, 23)
Me.Button7.TabIndex = 15
Me.Button7.Text = "Précédent"
'
'Button8
'
Me.Button8.Location = New System.Drawing.Point(296, 64)
Me.Button8.Name = "Button8"
Me.Button8.Size = New System.Drawing.Size(88, 24)
Me.Button8.TabIndex = 20
Me.Button8.Text = "Suprimer"
'
'Button9
'
Me.Button9.Location = New System.Drawing.Point(296, 32)
Me.Button9.Name = "Button9"
Me.Button9.Size = New System.Drawing.Size(88, 24)
Me.Button9.TabIndex = 19
Me.Button9.Text = "Ajouter"
'
'Form3
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(392, 222)
Me.Controls.Add(Me.Button8)
Me.Controls.Add(Me.Button9)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Button6)
Me.Controls.Add(Me.Button7)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form3"
Me.Text = "Form3"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sql = "select * from Client"
adapt = New OleDb.OleDbDataAdapter(sql, connec)
'adapt.SelectCommand = macommande
adapt.Fill(dset, "Client")
macommande = New OleDbCommandBuilder(adapt)
affiche()
'bmb = Me.BindingContext(dset, "client")
bmb = BindingContext(dset, "Client")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bmb.EndCurrentEdit()
Button5.Enabled() = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
Button4.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button9.Enabled() = True
'adapt.Update(dset, "Client")
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
bmb.Position = bmb.Count - 1
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Try
'adapt.Update(dset, "Client")
'Catch ex As Exception
'MessageBox.Show(ex.Message)
'End Try
Me.Close()
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
bmb.Position = 0
End Sub
Private Sub affiche()
TextBox1.DataBindings.Add("text", dset, "Client.Codeclient")
TextBox2.DataBindings.Add("text", dset, "Client.Nomclient")
TextBox3.DataBindings.Add("text", dset, "Client.Adresseclient")
TextBox4.DataBindings.Add("text", dset, "Client.CPclient")
TextBox5.DataBindings.Add("text", dset, "Client.Villeclient")
TextBox6.DataBindings.Add("text", dset, "Client.Telclient")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
bmb.Position -= 1
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
'adapt.Update(dset, "Client")
bmb.Position = bmb.Position + 1
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
bmb.AddNew()
Button9.Enabled = False
Button8.Enabled = False
Button3.Enabled = False
Button5.Enabled = False
Button7.Enabled = False
Button6.Enabled = False
Button4.Enabled = False
'Button1.Enabled() = True
'Button2.Enabled() = True
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
bmb.RemoveAt(bmb.Position)
Button5.Enabled() = True
Button9.Enabled() = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button9.Enabled = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
'Button1.Enabled = False
'Button2.Enabled = False
Button4.Enabled = True
bmb.CancelCurrentEdit()
End Sub

Private Sub Form3_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Try
adapt.Update(dset, "Client")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Dire « Merci » 3

Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire

Codes Sources 195 internautes nous ont dit merci ce mois-ci

Messages postés
6764
Date d'inscription
mardi 14 mai 2002
Statut
Contributeur
Dernière intervention
11 janvier 2016
0
Merci
salut,



que l'on se comprenne
bien, tu utilises un contrôle Binding qui te permets de LIER les
données mais est-ce que tu as bien coder la MISE A JOUR des données ?

si oui, quel bdd, quel méthode (DataAdapter, Command...) ?




[ Dalida ]<hr>
pensez à indiquer le langage utilisé et sa version !
Messages postés
6764
Date d'inscription
mardi 14 mai 2002
Statut
Contributeur
Dernière intervention
11 janvier 2016
0
Merci
salut,



que l'on se comprenne
bien, tu utilises un contrôle Binding qui te permets de LIER les
données mais est-ce que tu as bien coder la MISE A JOUR des données ?

si oui, quel bdd, quel méthode (DataAdapter, Command...) ?




[ Dalida ]<hr>
pensez à indiquer le langage utilisé et sa version !
Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
0
Merci
Voila le code que j'utilise
connec est ma connection
Voila et la base ne ce met pas a jour


imports System.Data.OleDb

Public Class Form3
Inherits System.Windows.Forms.Form

Public sql As String
Public macommande As OleDbCommand
Public adapt As New OleDbDataAdapter
Public dset As New DataSet
Public bmb As BindingManagerBase

Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sql = "select * from Client"
macommande = New OleDbCommand(sql, connec)
adapt.SelectCommand = macommande
adapt.Fill(dset, "client")
bmb = BindingContext(dset, "Client")
affiche()
Button2.Enabled = False
Button1.Enabled = False
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bmb.EndCurrentEdit()
Button5.Enabled() = True
Button9.Enabled() = True
Button9.Enabled = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
Button4.Enabled = True
Button1.Enabled = False
Button2.Enabled = False
'boutton annuler
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
bmb.Position = bmb.Count - 1
'boutton suprimer
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
'boutton quitter
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
bmb.Position = 0
'boutton premier
End Sub
Private Sub affiche()
TextBox1.DataBindings.Add("text", dset, "client.Code client")
TextBox2.DataBindings.Add("text", dset, "client.Nom client")
TextBox3.DataBindings.Add("text", dset, "client.Adresse client")
TextBox4.DataBindings.Add("text", dset, "client.CP client")
TextBox5.DataBindings.Add("text", dset, "client.Ville client")
TextBox6.DataBindings.Add("text", dset, "client.Tel client")
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
bmb.Position -= 1
'boutton précédent
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
bmb.Position = bmb.Position + 1
'boutton suivant
End Sub

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Button9.Enabled = False
Button8.Enabled = False
Button3.Enabled = False
Button5.Enabled = False
Button7.Enabled = False
Button6.Enabled = False
Button4.Enabled = False
bmb.AddNew()
Button1.Enabled() = True
Button2.Enabled() = True
'boutton ajouter
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
bmb.RemoveAt(bmb.Position)
Button5.Enabled() = True
Button9.Enabled() = True
'boutton supprimer
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bmb.CancelCurrentEdit()
Button9.Enabled = True
Button8.Enabled = True
Button3.Enabled = True
Button5.Enabled = True
Button7.Enabled = True
Button6.Enabled = True
Button4.Enabled = True
'boutton annuler
End Sub
End Class
Messages postés
6764
Date d'inscription
mardi 14 mai 2002
Statut
Contributeur
Dernière intervention
11 janvier 2016
0
Merci
ok !

il faut que tu répercutes les modifications car le BindingManager ne le fait pas.
il faut en premier appliquer les modifs au Dataset puis mettre à jour la base de données avec le DataAdapter. il faut parfois recharger le Dataset pour qu'il prenne en compte les champs avec incrémentation automatique.


en gros ça devrait faire :


bmb.EndInit() ' applique les modifs dans le DS


adapt.Update(dSet) ' met à jour la bdd

[ Dalida ]



<HR>



pensez à indiquer le langage utilisé et sa version !
Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
0
Merci
Quand je fais ça il me met cette ereur.

Une exception non gérée du type 'System.InvalidOperationException' s'est produite dans system.data.dll


Informations supplémentaires : Impossible pour Update de trouver TableMappings['Table'] ou DataTable 'Table'.

Du coup je fais ça


adapt.Update(dset, "Client")

Quand je fais ça il me fais cette ereur si tu as une idée d'ou cela vient?
Dans ma base de donnée access je n'ai pas que des type string j'ai aussi du format date et des entiers je ne sais pas si ça peut venir de la.
Merci de ton aide

Une exception non gérée du type 'System.InvalidOperationException' s'est produite dans system.data.dll


Informations supplémentaires : Update requiert un UpdateCommand valide lors du passage de la collection DataRow avec des lignes modifiées.
Messages postés
87
Date d'inscription
lundi 9 janvier 2006
Statut
Membre
Dernière intervention
11 novembre 2008
0
Merci
Bonne nouvelle a force de percévérence et avec un peut d'aide j'ai fini par y arriver.

Voici le code