Q:

Adding cell row to int array

I am currently trying to add a cell row into an int array. Can somebody point me in the right direction? I am able to add it to a string array as below but I am really struggling for the int array.
Your help is greatly appreciated.
DriverNames[z] = row.Cells[0].Value != null ? row.Cells[0].Value.ToString() : string.Empty;

Int array:
FinishTime1 = new int[dataGridView1.Rows.Count]

A:

Try
 DriverNames[z] = row.Cells[0].Value != null ?Convert.ToInt32(row.Cells[0].Value.ToString()) : 0;

If zero is valid entry Then array should be nullable so that we can insert null values in that array then expression becomes
int?[] DriverNames = new int?[dataGridView1.Rows.Count];
DriverNames[z] = row.Cells[0].Value != null 
    ? Convert.ToInt32(row.Cells[0].Value.ToString()) 
    : (int?)null;

A:

Maybe this?
DriverNames[z] = row.Cells[0].Value != null ? int.Parse(row.Cells[0].Value.ToString()) : 0;

