WinCE C# Exception 0x80000002

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LitaOsiris
    New Member
    • Jan 2008
    • 16

    WinCE C# Exception 0x80000002

    Hey,

    I'm getting a random error message in my program on a handheld that seems to happen when the program loads up. It comes up saying Fatal Application Error Exception 0x80000002. Looking that code up showed it as being a memory leak problem.

    The table adapters simply fill combo boxes with necessary customer and stock group info.

    Code:
    private void FormTran_Load(object sender, EventArgs e)
    {
    try
    {
         this.customerTableAdapter.Fill(this.acornDatabaseDataSet.Customer);
         this.stockTableAdapter.FillGroup(this.acornDatabaseDataSet.Stock);
    }
    catch
    {
    }
    }
    At the end of the program on exit, I do dispose these objects, but yet I still get the error when I go back into the program.


    Code:
    private void btnExit_Click(object sender, EventArgs e)
    {
          this.acornDatabaseDataSet.Dispose();
          this.customerTableAdapter.Dispose();
          this.customerBindingSource.Dispose();
          this.stockTableAdapter.Dispose();
          this.stockBindingSource.Dispose();
          this.Close();
          this.Dispose();
    }
    Is there something I'm leaving out that would cause this?

    I'm running WinCE5.0 using C# and a SQL Server Compact database.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What version of CF are you running on the system?
    Can you start a debug session?

    Comment

    • MonaLisaO
      New Member
      • Mar 2008
      • 13

      #3
      Originally posted by LitaOsiris
      Hey,

      I'm getting a random error message in my program on a handheld that seems to happen when the program loads up. It comes up saying Fatal Application Error Exception 0x80000002. Looking that code up showed it as being a memory leak problem.

      The table adapters simply fill combo boxes with necessary customer and stock group info.

      Code:
      private void FormTran_Load(object sender, EventArgs e)
      {
      try
      {
           this.customerTableAdapter.Fill(this.acornDatabaseDataSet.Customer);
           this.stockTableAdapter.FillGroup(this.acornDatabaseDataSet.Stock);
      }
      catch
      {
      }
      }
      At the end of the program on exit, I do dispose these objects, but yet I still get the error when I go back into the program.


      Code:
      private void btnExit_Click(object sender, EventArgs e)
      {
            this.acornDatabaseDataSet.Dispose();
            this.customerTableAdapter.Dispose();
            this.customerBindingSource.Dispose();
            this.stockTableAdapter.Dispose();
            this.stockBindingSource.Dispose();
            this.Close();
            this.Dispose();
      }
      Is there something I'm leaving out that would cause this?

      I'm running WinCE5.0 using C# and a SQL Server Compact database.
      You might be disposing of an object that is already null. This would cause a memory error.

      ~mona

      Comment

      • LitaOsiris
        New Member
        • Jan 2008
        • 16

        #4
        Originally posted by Plater
        What version of CF are you running on the system?
        Can you start a debug session?
        Version 2.0
        I've been trying that but it's hard to simulate since the error is random.

        Originally posted by MonaLisaO
        You might be disposing of an object that is already null. This would cause a memory error.

        ~mona
        The objects I have listed are used. I don't see how they would lose their values while the program is still in operation.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Well are you manually disposing objects that will get disposd by the form's disposing function?

          Comment

          • LitaOsiris
            New Member
            • Jan 2008
            • 16

            #6
            Originally posted by Plater
            Well are you manually disposing objects that will get disposd by the form's disposing function?
            Even without the code on exit I would still get the error.

            I found a solution though. It involved getting rid of all the components that were added to the program and replacing it with code of my own that would do the job instead. It appears to have worked.

            Comment

            Working...