I would like to retrieve the ID number for that row that was just inserted into the database.
Dim Enrollment As New Enrollments With Enrollment .Student_ID = CInt(lvwStudents.FocusedItem.Text) .Enrollment_Date = CDate(dtpDate.Text) End With EnrollmentBAL.Save(Enrollment)
I have this code to save it from the database, what I want to do is after saving it I want to get the value of its ID and pass it to another table. can anyone help me on how to this or whats the best way to this. Thanks