How to create a transaction log
I have an Invoice program which I am working on. I want to know how to create an entry into another database after it saves the invoice to log the payment details in a seperate database. I have enclosed my code, no errors on debug, but no entries into the close-out database either.
Code:
Me.Validate()
Me.InvoicesBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CloseoutsDataSet)
MessageBox.Show("Account Updated")
Me.TotalAmountTextBox.Text = SubtotalTextBox.Text
Me.TransactionAmountTextBox.Text = GrandTotalTextBox.Text
Me.PaymentTypeTextBox.Text = PaymentTypeComboBox.Text
Me.TransactionNoTextBox.Text = InvoiceNoTextBox.Text
Me.CloseoutsBindingSource.EndEdit()
Me.CloseoutsTableAdapter.Update(CloseoutsDataSet.Closeouts)
What in the world am I doing wrong? As you can see, I am updating two databases. One stores the details of the Invoice and the other logs the payments for Cashier Close-outs.
Thanks in advance!
Re: How to create a transaction log
Quote:
Originally Posted by DL1600
As you can see, I am updating two databases.
Where, and how, are you updating two databases with that code?
Re: How to create a transaction log
InvoicesBindingSource and CloseoutsBindingSource are your datagridviews?
You need to post more information/code.
Re: How to create a transaction log
What value is returned by the CloseoutsTableAdapter.Update function? If it's zero then your DataTable simply doesn't contain and changes that can be saved by that adapter. If it's greater than zero then the changes are being saved. If you're not getting any exception thrown then those are the only two possibilities.