I already make the code but there's a problem. The compiler show me this message:
Object reference not set to an instance of an object. This is the code:
Dim array As List(Of String)
For Each row As DataGridViewRow In DataGridView1.Rows
If Not row.IsNewRow Then
array.Add(row.Cells(0).Value.ToString & "," & row.Cells(1).Value.ToString & _
row.Cells(2).Value.ToString & "," & row.Cells(3).Value.ToString)
End If
Next
The line with the problem is array.add
What's the problem?