Results 1 to 3 of 3

Thread: Machine dependent error

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,509

    Machine dependent error

    I have a .Net 2005 program that runs fine on two of the three machines in the clients office. I get and "indexoutofrange" error when "FormClosing" is executed, the index number changes depending where I am in the grid.
    Code:
        Private Sub SaveApplicationData()
            Try
                Me.Validate()
                Me.ApplicationBindingSource.EndEdit()
                Me.ApplicationTableAdapter.Update(Me.NautiqueDataDataSet.Application)
            Catch ex As Exception
                MessageBox.Show(ex.ToString)
            End Try
        End Sub
    
        Private Sub frmApplication_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            SaveApplicationData()
        End Sub
    I think that's what causes the error, it doesn't error on my development machine so I'm can't be sure. It happens when I click the form close button and that code is the only code in the form closing event. The "Me.NautiqueDataDataSet.Application" datatable is bound to a DGV. There are no other controls on the form, except a binding navigator.

    There are other input screens that work fine so I know that the machine has read/write privileges. This machine was just added to the network and I ran the SetUp program, it's a laptop, windows 7 Pro 32 bit.

    There are other .Net 2005 programs on this machine that use a DGV and they work fine

    The other two machines are Windows XP 32 bit, but the programs runs fine on development machine Window 7 64 bit, and my laptop, Windows 8 64 bit.

    Not sure how to debug this.

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

    Re: Machine dependent error

    It would be interesting to see the stack trace for the exception to determine exactly what index is out of range.
    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

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,509

    Re: Machine dependent error

    jmc,
    Thanks for the reply.

    I've been thinking, when this happens, the error keeps redisplaying after you press OK. You have to open the Task Manager and end the process. The "SaveApplicationData" function has a Try/Catch, seem like this should let the form close.

    Next time I'm out at their office I think I'll try testing the problem by having it write to a log file so I'll know for sure which line is causing the error.

    If I can't find the problem I'll bring back more information on the error.

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