i use this code to update the data in my databae , but i get error
this is the code
Private Sub StokBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StokBindingNavigatorSaveItem.Click
Validate()
StokBindingSource.EndEdit()
StokTableAdapter.Update(Database1DataSet.stok)
End Sub
The error
System.InvalidOperationException was unhandled
Message="Voor het bijwerken is een geldige UpdateCommand vereist wanneer een DataRow-verzameling wordt doorgegeven met gewijzigde rijen."
Source="System.Data"
StackTrace:
bij System.Data.Common.DbDataAdapter.UpdatedRowStatusE rrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bij System.Data.Common.DbDataAdapter.UpdatedRowStatus( RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bij System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
bij System.Data.Common.DbDataAdapter.UpdateFromDataTab le(DataTable dataTable, DataTableMapping tableMapping)
bij System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
bij Cataloog.Database1DataSetTableAdapters.stokTableAd apter.Update(stokDataTable dataTable) in C:\Documents and Settings\kim\Mijn documenten\Visual Studio 2005\Projects\Cataloog\Cataloog\Database1DataSet.D esigner.
vb:regel 742
bij Cataloog.stok.StokBindingNavigatorSaveItem_Click(O bject sender, EventArgs e) in C:\Documents and Settings\kim\Mijn documenten\Visual Studio 2005\Projects\Cataloog\Cataloog\stok.
vb:regel 6
bij System.Windows.Forms.ToolStripItem.RaiseEvent(Obje ct key, EventArgs e)
bij System.Windows.Forms.ToolStripButton.OnClick(Event Args e)
bij System.Windows.Forms.ToolStripItem.HandleClick(Eve ntArgs e)
bij System.Windows.Forms.ToolStripItem.HandleMouseUp(M ouseEventArgs e)
bij System.Windows.Forms.ToolStripItem.FireEventIntera ctive(EventArgs e, ToolStripItemEventType met)
bij System.Windows.Forms.ToolStripItem.FireEvent(Event Args e, ToolStripItemEventType met)
bij System.Windows.Forms.ToolStrip.OnMouseUp(MouseEven tArgs mea)
bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bij System.Windows.Forms.Control.WndProc(Message& m)
bij System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
bij System.Windows.Forms.ToolStrip.WndProc(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
bij System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bij System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
bij System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bij System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
bij System.Windows.Forms.Application.Run(ApplicationCo ntext context)
bij Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
bij Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
bij Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
bij Cataloog.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.
vb:regel 81
bij System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bij System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bij Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
bij System.Threading.ThreadHelper.ThreadStart_Context( Object state)
bij System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
bij System.Threading.ThreadHelper.ThreadStart()