system.nullreferenceexception 未将对象引用设置到对象的实例。

DataGridView 导出时出现的问题。

可能grid行的单元的没有值。

 

------------------------------------------------------------------------------

if (dataGridview1.Rows[j].Cells[k].Value != null)
{
          tempStr += dataGridview1.Rows[j].Cells[k].Value.ToString();
}

posted @ 2009-09-07 14:42  汉城  阅读(496)  评论(0编辑  收藏  举报