I Want to add a row in my dataset(dsStudent), i get an error:
my code:
the dataset is filled with items from a XML file.
Thanks
POL
An unhandled exception of type 'System.NullReferenceException' occurred in XMLFile2.exe
Additional information: Object reference not set to an instance of an object.
my code:
VB.NET:
Public Sub addStudent(ByVal nStundent As Student)
Dim DataRow1 As DataRow
DataRow1.Item("name") = CStr(nStundent.Naam) ' <- error in this line
DataRow1.Item("geboortedat") = CDate(nStundent.GeboorteDatum)
DataRow1.Item("email") = CStr(nStundent.Email)
DataRow1.Item("idNummer") = CInt(nStundent.Id)
dsStudent.Tables(0).Rows.Add(DataRow1)
End Sub
Thanks
POL
Last edited by a moderator: