Try Catch RRS feed

  • Question

  • Hi All


    I found that while using the Entity framework, I need to use try catch to catch the exception.


    But I don't want to write try and catch eveywhere. Is it possible that I don't use this approach?


    For example 1/0 will throw overflow exceptinon without using try-catch?

    Monday, July 7, 2008 8:06 AM

All replies

  • Hello,

    It is not clear to me what problem you are seeing. Is that you need to do more exception management than usual when using Entity Framework? Or is there some specific scenario? Please elaborate.


    Monday, July 7, 2008 8:21 AM
  • For example,


    If I insert duplicate records, it don't prompt up the error message and it just acting normal.


    What  I need to do is to add try-catch block to trap the error. Is it possible not to use try- catch block?



    Monday, July 7, 2008 8:29 AM