Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Need some help with code

Need some help with code

Scheduled Pinned Locked Moved Visual Basic
helpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harry2004
    wrote on last edited by
    #1

    When I click on the save button I get a error. Here is the code Private Sub SaveRecord() Dim pdsSaveRow As DataSet Me.BindingContext.(Me.DsCustomerIndividual1, "Customers").EndCurrentEdit() pdsSaveRow = DsCustomerIndividual1.GetChanges(DataRowState.Modified) odaCustomerIndividual.Update(pdsSaveRow) Me.DsCustomerIndividual1.Customers.AcceptChanges() End SubPrivate Sub SaveRecord() Dim pdsSaveRow As DataSet Me.BindingContext(Me.DsCustomerIndividual1, "Customers").EndCurrentEdit() pdsSaveRow = DsCustomerIndividual1.GetChanges(DataRowState.Modified) odaCustomerIndividual.Update(pdsSaveRow) Me.DsCustomerIndividual1.Customers.AcceptChanges() End Sub

    T 1 Reply Last reply
    0
    • H Harry2004

      When I click on the save button I get a error. Here is the code Private Sub SaveRecord() Dim pdsSaveRow As DataSet Me.BindingContext.(Me.DsCustomerIndividual1, "Customers").EndCurrentEdit() pdsSaveRow = DsCustomerIndividual1.GetChanges(DataRowState.Modified) odaCustomerIndividual.Update(pdsSaveRow) Me.DsCustomerIndividual1.Customers.AcceptChanges() End SubPrivate Sub SaveRecord() Dim pdsSaveRow As DataSet Me.BindingContext(Me.DsCustomerIndividual1, "Customers").EndCurrentEdit() pdsSaveRow = DsCustomerIndividual1.GetChanges(DataRowState.Modified) odaCustomerIndividual.Update(pdsSaveRow) Me.DsCustomerIndividual1.Customers.AcceptChanges() End Sub

      T Offline
      T Offline
      Tom John
      wrote on last edited by
      #2

      What's the error you are getting?

      H 1 Reply Last reply
      0
      • T Tom John

        What's the error you are getting?

        H Offline
        H Offline
        Harry2004
        wrote on last edited by
        #3

        See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.InvalidOperationException: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) at System.Data.Common.DbDataAdapter.Update(DataSet dataSet) at How_To_1._1.Form1.SaveRecord() in C:\Documents and Settings\Harrison\My Documents\Visual Studio Projects\How-To 1.1\Form1.vb:line 504 at How_To_1._1.Form1.txtSave_Click(Object sender, EventArgs e) in C:\Documents and Settings\Harrison\My Documents\Visual Studio Projects\How-To 1.1\Form1.vb:line 514 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll ---------------------------------------- How-To 1.1 Assembly Version: 1.0.1780.42193 Win32 Version: 1.0.1780.42193 CodeBase: file:///C:/Documents%20and%20Settings/Harrison/My%20Documents/Visual%20Studio%20Projects/How-To%201.1/bin/How-To%201.1.exe ---------------------------------------- System.Windows.Forms Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll ---------------------------------------- System Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll ---------------------------------------- System.Drawing Assembly Version: 1.0.5000.0

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups