Image in SQL Database

Soumyadip
Soumyadip Member Posts: 209
Hi,

Scenario:
I am running NAV 4.0 SP3 with SQL server DB. I have a .NET application that access the same SQL server DB and Read/Write data in to a Custom Developed Table (ID: 50000).

Problem:
When i am storing an image file (BMP) in the database via .NET application, i can read it via .NET application but not via NAV.

Can any one help me out with this prob???

Thanks in advance.

Comments

  • gulamdastagir
    gulamdastagir Member Posts: 411
    if you are able to import the image from .NET into a Blob field in Navision then i dont see why shouldn't you be able to see it in Navision.

    Or else you can create a form with an import button
    and write the follwing code this will work for sure:


    PictureExists := Picture.HASVALUE;
    IF Picture.IMPORT('*.BMP',TRUE) = '' THEN
    EXIT;
    IF PictureExists THEN
    IF NOT CONFIRM(Text001,FALSE,TABLECAPTION,"No.") THEN
    EXIT;
    CurrForm.SAVERECORD;
    Regards,

    GD
  • kine
    kine Member Posts: 12,562
    Do not forget to disable the "Compressed" property on the BLOB, else Nav will assume that the data in the blob are compressed and will not understand the plain data.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Please be very carefull with storing BLOB's in a SQL database.

    Even though it is not calculated by default. The SELECT statement in NAV does a DATALENGHT query which can result in slow performance.