C# Winform Table Adapter suddenly not saving to DB

I have a C# Winform app that I wrote a couple of months ago that has been working fine, but recently has ceased to update my database when Im calling the TableAdapter.Update function. I have this in a try / catch block, and it is not throwing any errors. If I put a Breakpoint on the Update line, I can see all my new values in the various form fields, but it again it doesnt throw any exceptions. My connection string to the DB must be good because my Fill query works.

Below is my code:
 private void SaveButton_Click(object sender, EventArgs e)
        {         
                try
                {
                    this.Validate();
                    this.taEditBindingSource.EndEdit();                  
                    this.taEditTableAdapter.Update(this.ONLINE_STOREDataSet.taEdit);
                    var form = new SaveConfirmed(); //Displays my Custom Confirmation Box
                    form.Show();
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show("Update failed:\n" + ex);
                }
				
        }

Open in new window


Any ideas are appreciated.
hhnetworksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Does the DataSet have any changes when the Update is called?
0
hhnetworksAuthor Commented:
I believe so. When I enter or change data in the List View and if I put a breakpoint at Line 7 in the code above, I can drill into the dataset in debugger and see changes Ive made in the various fields
0
Bob LearnedCommented:
Another way to see if a DataSet has changes, there is the DataSet.GetChanges method:

DataSet.GetChanges Method
https://msdn.microsoft.com/en-us/library/a4ey25we(v=vs.110).aspx

For example, if there is a call to AcceptChanges, that the system will change the row states to Unmodified, and there won't be any changes.

Also, does the SqlDataAdapter have an UpdateCommand, InsertCommand, and DeleteCommand?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hhnetworksAuthor Commented:
Thanks Bob.

Additional debugging revealed that I had an Event Handler elsewhere that was calling the Fill function of my dataset before changes were being saved.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.