I want to add dates to an array given start and end dates.
I already tried declaring it as an Array and an ArrayList but it gave the same error at the same exact line. Here is the sample code:
Dim startP As DateTime = New DateTime(2019, 3, 27)
Dim endP As DateTime = New DateTime(2019, 3, 30)
Dim CurrD As DateTime = startP
Dim DateArray As ArrayList
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
While (CurrD <= endP)
DateArray.Add(CurrD)
CurrD = CurrD.AddDays(1)
End While
End Sub
Both gave the error "NullReferenceException was unhandled"