Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

I am getting this error... I need help with this code...

$
0
0

SO I created a simple windows form displaying SQL data.  I need to be able to make small changes like the names of the products and so on.  I am able to make the changes while running the form and I can also delete, but when I click the default save button to update the sql data, it gives me this error....

An unhandled exception of type 'System.InvalidOperationException' occurred in WindowsFormsApplication6.exe

Additional information: Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.

What am I doing wrong?  isn't the default save button for the data nodes supposed to make changes automatically?  the code for the save button is as follows:

  private void chips_BindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.chips_BindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.replenishmentDataSet);
            
        }

I am pretty new to C#, so I apologize if what I am asking is confusing.  Can someone steer me in the right direction please?  Even if you have to repond like your speaking to a 5 year old.  I just want to get this right.  Overall the program is supposed to allow the user to make changes on the table by adding, deleting or editing current items.  The saving part is crucial.  I want it to save any change that the user makes.  This is seriously the last part of the project and I am stuck... PLEASE HELP!!


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>