Obtain the Query/CommandText that caused a SQLException

前端 未结 3 791
北荒
北荒 2020-12-06 16:40

I\'ve got a logger that records exception information for our in house applications.

When we log SQL exceptions it\'d be super useful if we could see the actual quer

3条回答
  •  独厮守ぢ
    2020-12-06 17:18

    You can NOT throw a sql exception. I think he meant to throw a new Exception that contains the command.CommandText.

提交回复
热议问题