Problème d'insertion =>Impossible pr Update de trouver TableMapping['Bdd'] ou DataTab
Bonjour à tous!
Je developpe une application en VB.net 2005 qui doit remplir une BDD Access...
Je n'arrive plus à effectuer d'insertion alors que j'arrive encore à consulter et qu'auparavant je n'avais aucun problèmes.
L'érreur qui survient est la suivante :
Citation:
L'exception InvalidOperationException n'a pas été gérée
Impossible pour Update de trouver TableMapping['Bdd'] ou DataTable 'Bdd'.
Code relatif à la connexion :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Public Cnx As New OleDb.OleDbConnection
Public DtaSet As New DataSet
Public DtaAdapt As OleDb.OleDbDataAdapter
Public CmdBuild As OleDb.OleDbCommandBuilder
Public Sub connexion()
Cnx.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & System.Windows.Forms.Application.StartupPath & "\IanAppliBDD.mdb"
If Cnx.State = ConnectionState.Open Then
Cnx.Close()
End If
Cnx.Open()
End Sub |
Code relatif à l'insertion :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Imports System.Data
Dim sql As String
Private Sub ajouter()
sql = "INSERT INTO saisie ( Dates, NomPrenom, Categorie, Mois, BCL, TempPasse, Poste ) VALUES ('" & Tdates.Text & "', '" & nom.Text & "', '" & cat.Text & "','" & mois.Text & "','" & bcl.Text & "', '" & tps.Text & "', '" & poste.Text & "');"
DtaAdapt = New OleDb.OleDbDataAdapter(sql, Cnx)
DtaAdapt.Fill(DtaSet, "Bdd")
DtaAdapt.Update(DtaSet, "Bdd")
End Sub |
Je suis sûre que la solution n'est pas loin mais là, je vois pas !!
Merci d'avance à tous pour votre interet et pour votre aide eventuelle!!
IaN