Forum Topic

how to save multiple images in one column sql server, vb.net

  • Hi guys pano po mag add ng multiple files or images sa isang row, sa sql server using vb.net?. For example: si User1 ay mag-uupload ng multiple images. nakakapag save na ko ng image kaso 1:1 ratio lang lang user1=1image.

    ganto po ung structure ng database ko:

    user| image |

    sample value :

    user1 | <binary data> |

    ang gusto ko po mangyari is:

    user1 user1 | <binary data1>, <binary data2>, <binary data3>, |

    possibe po ba kaya un?. or merong other way para makapag save ng maraming images?.
  • Question:

    Is there a requirement to that kind of db structure?

    Can\'t you structure you database in a different way?
  • @Jabongga

    what do you mean sir?, sorry sir d ko maintindihan, d ko na rin alam kung pani gagawin :(
  • Ang intindi ko sa DB structure mo, gusto mo nasa isang row lang yung user at yung image/s.

    Why not make a user table with a primary key(PK), then create an images table and reference nalang yung (PK) ng user table.

    Example:

    *USER TABLE*

    UID | USERNAME
    009 | USERA

    *IMAGES TABLE*

    IID |UID |IMAGEBINARY
    001 |009 | Image1
    002 |009 | Image2
    003 |009 | Image3
  • @Jabongga
    thanks sir, mukang mahihirapan ako neto sa pag cocode sa vb, try ko i-recall ung ERD. wala na po kasi ako ma-asahan sa school kaya nag-sasarili nlang.

    ano nga po pala ung IID dito?
    *IMAGES TABLE*

    IID |UID |IMAGEBINARY
    001 |009 | Image1
    002 |009 | Image2
    003 |009 | Image3
  • ImageId / ID / Whatever you want. :)