Results 1 to 4 of 4

Thread: Somehow change Sql error into user friendly message

  1. #1

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Somehow change Sql error into user friendly message

    We want our webservice to return only the descriptive message part of a Sql error to the client . As it stands, we get a SOAP error, along with all the baggage.

    Our exact problem:

    We want the Sql Server Error : Concurrent Limit Exceeded ,
    to be exactly what we show when someone tries to login at a client app.

    The webservice is of course wrapping into SOAP, and we need to devise a way to simply get that original error to display to the user.

    Any suggestions?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I have very limited experience working with web services and even less working with SOAP (unless the shower counts). But can't you catch the sql error and return whatever you want via the webservice call? Or is this not related to a particular method in the web service but the web service as a whole?

  3. #3

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Unfortunately no, the WebService must raise a SoapException error... we are going to just parse the .Message for the culprit, and display that to the user. Seems like the only way to do this.

    Thanks anyway.

  4. #4
    Addicted Member
    Join Date
    Sep 2003
    Posts
    160
    are you using VB ? maybe I am missing something with soap but with all error happen in vb you can handle it yourself by this.

    On Error GoTo KeepError

    <codes here>



    end <or> exit sub
    KeepError:

    Select Case Err.Number

    Case 3027

    case ...


    end select


    hope it helps
    S. Mohammad Najafi

    PS: it may happen for me that my sql string have problem or something is null inside so each one of them have specified error number that you can put into your Select case

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