Results 1 to 4 of 4

Thread: How to create a transaction log

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    131

    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!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to create a transaction log

    InvoicesBindingSource and CloseoutsBindingSource are your datagridviews?
    You need to post more information/code.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width