开发者

upload image during registration in asp.net

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开发者_C百科 this. thanx.


Your algorithm:

  1. Add new user, get Id of user.
    • The user is NOT optional and must be created. If not possible, the whole thing stops
  2. Look for the upload image, if not found return.
  3. Save the image, associating it to 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜