Results 1 to 4 of 4

Thread: [2005] Error Trapping Help Please

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [2005] Error Trapping Help Please

    Hello,

    I am stumbling my way through VB.Net, but one area I struggle with is Error Trapping.

    Basically I am getting the following error when I try to insert an entry into my table on the DB.

    Code:
    System.Web.Services.Protocols.SoapException: 
    Server was unable to process request. --->
    System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint
    'PK_tbl_Holidays'. Cannot insert duplicate key in object 'tbl_Holidays'.
    The statement has been terminated.
    blah
    blah
    blah.....
    Now I know why I am getting this error obviously, but I'd like to display a friendly message to the user to advise them, rather than them getting a large soap error message like this.

    How can I do this ?
    And are there any resources you'd recommend to deal with error trapping ?
    Last edited by Jonny1409; Aug 23rd, 2007 at 06:53 AM.

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