Without more information i am struggling to understand this, are uploading the files to the database?
You could always rename the PDF sequentially starting with the enrollmentid PK.
For example:
Original File: MyUploadedDocumentForDev.pdf
New File Name: <enrollment_id>_<count_of_pdf_with_this_prefix.pdf>
Enrollment Id: 12345678
Total Docs starting with 12345678 = 4
New File: 12345678_8.pdf.
Then in VB, instead of enumerating all uploaded files, you just enumerate anything that begins with 12345678*.pdf.
If you are inserting a record into the database to show that you have uploaded a pdf, you can add another column in as a
ForeignKey
which is the Enrollee's Enrolment ID.
INSERT INTO [MyDB].[dbo].[MyPDFTable] (EnrollmentId, PDFName, PDFDirectory) VALUES ('12345678','12345678_4.pdf','/home/wwwroot/uploads')
Where EnrollmentId is the same enrollment id as the enrollee'
then on your page
SELECT * FROM [MyDB].[dbo].[MyPDFTable] WHERE EnrollmentId = '12345678'
Without more info struggling to offer more advice.