I am trying to pull Excel data to an array and I keep receiving this error any help would be great.
Thanks.
string[,] Datavalue = new string[dataGridView1.Rows.Count,dataGridView1.Columns.Count];
foreach(DataGridViewRow row in dataGridView1.Rows)
{
foreach(DataGridViewColumn col in dataGridView1.Columns)
{
Datavalue[row.Index, col.Index] =
dataGridView1.Rows[row.Index].Cells[col.Index].Value.ToString();