Results 1 to 3 of 3

Thread: [RESOLVED] pls give an input

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] pls give an input

    Hi,

    PHP Code:
    using (object myobj = new object())
    {
        
    // code here
        // error occur here
        // code here

    if error occur, what happen to my myobj? is it dispose or not?

    Thanks,
    POpskie

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

    Re: pls give an input

    The whole point of the 'using' keyword is exactly that: the object is disposed even if an exception is thrown within. That's the whole reason for its existence. That's also the reason that only types that implement the IDisposable interface can be created by a 'using' statement.

    Please provide descriptive thread titles.
    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

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