System.ObjectDisposedException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claudia Fong

    System.ObjectDisposedException



    Hello,

    I'm using a form to display a result of a simple sql statement (SELECT *
    FROM DEP);

    I have buttons like EDIT, DELETE. I want to do is kind of "refreshing
    stuff". I try

    this.Close();
    this.Show();


    but generates this error --> Cannot access a disposed object name form1


    I used to do unload form and then form.show in VB, but in C#, there's no
    unload method... what should I do?

    Can anyone help me?

    Cheers!

    Claudi

    *** Sent via Developersdex http://www.developersdex.com ***
  • Jon Skeet [C# MVP]

    #2
    Re: System.ObjectDi sposedException

    Claudia Fong <cdolphin88@yah oo.co.uk> wrote:[color=blue]
    > I'm using a form to display a result of a simple sql statement (SELECT *
    > FROM DEP);
    >
    > I have buttons like EDIT, DELETE. I want to do is kind of "refreshing
    > stuff". I try
    >
    > this.Close();
    > this.Show();
    >
    > but generates this error --> Cannot access a disposed object name form1
    >
    > I used to do unload form and then form.show in VB, but in C#, there's no
    > unload method... what should I do?[/color]

    What *exactly* do you want to do which isn't done automatically?
    Calling Invalidate on a control is usually enough to get it painted
    again, if that's what you're after.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    Working...