且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查是否在列的单元格值!= NULL?

更新时间:2023-11-29 08:43:10

inzi伊琳娜请看看这个code。不要忘了投我,如果这可以帮助你。

inzi irina Please look at this code. don't forget to vote me if this helps you

private void button2_Click(object sender, EventArgs e)
    {
        foreach (DataGridViewRow dr in dataGridView1.Rows)
        {
            string lngth = Convert.ToString(dr.Cells[1].Value);
            if (lngth.Length > 0)
            {
                listBox1.Items.Add(dr.Cells[0].Value);
            }
        }
    }