What do I do to fix an "Object reference not set to an instance of an object" error. Which object is it referring to? code:
Private Sub dvSMasterCurrentYear_DataBound(sender As Object, e As EventArgs) Handles dvSMasterCurrentYear.DataBound
Dim dv As DetailsView = New DetailsView
If DetailsViewMode.Insert Then
DirectCast(dv.FindControl("PlantYear"), TextBox).Text = GetYear()
End If
End Sub
Get Year returns to current year, it appears in the detailsview textbox "PlantYear". I try to insert the value using the above code.
thanks for your help.