I am developing a student registration form in asp.net. there are two tables viz std_registration and gallery(having pic_id and pic_url). During registration, before the click of submit button i want to retrieve pic_id from gallery table and then pass it to the insert query of registration table.
image upload is an optional part. if no image is uploaded i want a default image to get uploaded.
pls help me on this. thanx.
Your algorithm:
whole thing stops
upload image, if not found return.
the user id.
Your tables should look like:
User
Id whatever PK
Name nvarchar(up to you)
YaddaYadda
ProfileImage
Id whatever PK
UserId whatever FK
Image Blob
The foreign key should NOT be in the User table. You aren’t sharing images between users.