小编Sal*_*ami的帖子

无法处理StackOverflowException C#

我不知道为什么我无法处理由该代码引起的此异常:

    private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            for (int i = 0; i < checkedListBox1.Items.Count; i++)
            {
                    int id = int.Parse(((DataRowView)checkedListBox1.Items[i])[0].ToString());
                    bool check = checkedListBox1.GetItemChecked(i);
                    DataRow[] dr = dt.Select("id = " + id.ToString());
                    dr[0][2] = check;
            }
        }
        catch (StackOverflowException) { }
    }
Run Code Online (Sandbox Code Playgroud)

图像:未处理的StackOverflowException

.net c# stack-overflow exception-handling exception

0
推荐指数
1
解决办法
443
查看次数

标签 统计

.net ×1

c# ×1

exception ×1

exception-handling ×1

stack-overflow ×1