SQL SERVERから発生した内部例外をキャッチし、WPFのMessegeBoxでその例外を表示したい
前もって感謝します
SQL SERVERから発生した内部例外をキャッチし、WPFのMessegeBoxでその例外を表示したい
前もって感謝します
使用できる方法の1つは次のとおりです。
try
{
//Some commands that can raise an exception
}
catch (Exception e)
{
Exception inner = e.InnerException ?? e;
while (inner.InnerException != null)
{
inner = inner.InnerException;
}
//inner exception will contain the innerest exception
}