2

SQL SERVERから発生した内部例外をキャッチし、WPFのMessegeBoxでその例外を表示したい

前もって感謝します

4

1 に答える 1

-1

使用できる方法の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

        }
于 2012-04-26T06:24:27.730 に答える