Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have an existing Enrollment table with many records on SQL Server 2008 R2 and

I need to browse to upload pdf file/s for each record and show them on Enrollment page.Enrollment page is developed in vb.net.

EnrollmentID is the primary key. So when I open each enrollment, I should see only that enrollmen's uploaded file.

How can I achieve that by using vb.net?

Thanks
Posted
Comments
ZurdoDev 17-Sep-15 16:29pm    
By writing a lot of code. Where are you stuck?

1 solution

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.

SQL
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

SQL
SELECT * FROM [MyDB].[dbo].[MyPDFTable] WHERE EnrollmentId = '12345678'


Without more info struggling to offer more advice.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900