Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3351584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:55:35+00:00 2026-05-18T01:55:35+00:00

I am ask a question in Interview that we are developing a WPF application

  • 0

I am ask a question in Interview that we are developing a WPF application which calls some StoredPeocedure. If there is an error in StoredProcedure during execution or any error occur in database how do we now in application and show this gracefully to the client.

Means the error is in SQl on Server and application should be aware of it that how to show that one.

I answer to use try catch statement but the interviewer did not accept that answer. I google it but could not get any answer.

can anyone tell me the suitable way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:55:36+00:00Added an answer on May 18, 2026 at 1:55 am

    Well, try/catch by itself doesn’t really do much, and it would certainly be bad practice to present a UI dialog from your DAL/DB/repo layer. I would:

    • in the DAL catch the expected SQL exception and throw a documented exception that the UI can expect
    • in the UI layer, catch the exception you threw and present a suitable dialog to the user

    Of course, your UI should really expect to catch any exception in this scenario; simply it might put a friendlier face on an expected (predictable) exception – and be more cautious in the case of something it didn’t expect.

    An even better answer would be: verify your scenario up-front, so that you don’t expect an exception at all – then any exception is exactly that: exceptional.

    As a general point though: never be afraid to ask the interview what they had in mind; you might then be able to discuss the merits (and not) of each approach. Also, never assume that the interviewer knows everything. I would have absolutely no qualms telling an interviewer (nicely, mind) that they are mistaken about a technical point. It might be sneaky, but the interviewer might actually be looking for someone who isn’t afraid to speak up when someone makes a technical error, and is therefore injecting subtle gibberish into technical discussions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.