Bonjour,
Voilà j 'ai réalisé une appalication vb + access, donc je lis et modifie ma base de données , donc j 'ai ma commande :
Me.DonneesTableAdapter.Update(Me.BaseDataSet.Donnees)
Donc si je rajoute des élement et que j'enregistre , j ai pas de problèmes , mais si je refait des changements et que j'execute ma commande une deuxième fois , j'ai un message d'erreur , qui est le suivant :
Violation de l'accès concurrentiel : UpdateCommand a affecté 0 des enregistrements 1 attendus.
et plus précisement :
L'exception System.Data.DBConcurrencyException n'a pas été gérée
Message="Violation de l'accès concurrentiel : UpdateCommand a affecté 0 des enregistrements 1 attendus."
RowCount=1
Source="System.Data"
StackTrace:
à System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
à System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
à System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
à System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
à System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
à Davidson.baseDataSetTableAdapters.DonneesTableAdapter.Update(DonneesDataTable dataTable) dans C:\Tmp\davidson3\davidson\baseDataSet.Designer.vb:ligne 5082
à Davidson.Form1.DonneesBindingNavigatorSaveItem_Click_1(Object sender, EventArgs e) dans C:\Tmp\davidson3\davidson\Form1.vb:ligne 111
à System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
à System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
à System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
à System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
à System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
à System.Windows.Forms.ToolStrip.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
à System.Windows.Forms.Form.ShowDialog()
à Davidson.LoginForm1.OK_Click(Object sender, EventArgs e) dans C:\Tmp\davidson3\davidson\LoginForm1.vb:ligne 26
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à System.Windows.Forms.Button.PerformClick()
à System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
à System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
à System.Windows.Forms.Control.PreProcessMessage(Message& msg)
à System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
à System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
à System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.Run(ApplicationContext context)
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
à Davidson.My.MyApplication.Main(String[] Args) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 81
à System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
à System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
à System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
à System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
à System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
Donc si quelqu'un connaît la raison de ce problème , je suis preneur d'une eventuelle solution.
Merci
Partager