How to get detailed ExecuteNonQuery error message?

后端 未结 2 986
广开言路
广开言路 2021-01-19 18:51

I\'m working on my first ever assignment in ASP.NET. It\'s a website and I work in Visual Studio.

What I can\'t figure out is how to get a detailed error message to

2条回答
  •  被撕碎了的回忆
    2021-01-19 19:34

    Change your catch to be catch (Exception ex) and you can then use Response.Write(ex.Message)

    Ideally, you would have different catches for different exception types. This is a bucket approach to catching all exceptions.

提交回复
热议问题