Results 1 to 4 of 4

Thread: Error handling

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97

    Error handling

    say if i've got 3 classes like so

    WebFrm > UserClass > DBClass

    how do i catch an error in the web form when its thrown in the db class i know u can esculate errors but im not sure how 2


    many thanks
    zee

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Just don't handle the errors. They should bubble up.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97
    sensible answers on a postcard 2

    Dontbesilly
    po box need a solution
    Answerville

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    In your web form, add your code that may potentially cause an exception into a try..catch block..

    Code:
    try {
        Customer.Add(myCustomer);
    }
    catch (Exception ex) {
        MessageBox.Show(ex.Message);
    }

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