Image upload error

Image upload error

  

hii,

i am trying to upload image into database but it gives following error.


The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_7J3_PRODUCT_PHOTO_OSUSR_7J3_PRODUCTS_ID". The conflict occurred in database "IVR4AB020", table "dbo.OSUSR_7J3_PRODUCTS", column 'ID'. The statement has been terminated.

Hi Manish,

Before saving the image on the database you need to fill the productId

Regards,

Marcelo

Hi Manish,

This is not image upload error, this foreign key error, the product id you are trying to insert in the product_photo table is not exists, can you verify your data model, and verify if product id exists in products table.


Thanks,

Balu

hi maecelo,

i fill the productid but still its give an error


i have an another question ,

how to retrive image from database


Hi Manish,

The productId you are assigning to Product Photo is different than 0 and exists on the Product table?  Maybe you can share a print screen of you saving the image on the database.

To retrieve you just need to do an aggregate to get the image. Check this https://success.outsystems.com/Documentation/10/Developing_an_Application/Design_UI/Images/Display_an_Image

Regards,

Marcelo

hi,

i am trying to display table in list but it shows only 4 records.

plz see the attachment