Monday, 27 October 2014

How to store images in a table

In this code we provide an example of how to store an image in a Dynamics AX table.
  1. The image is stored in a field of the Data type Container and you can use the Extended data type Bitmap.
1

  1. Use the Class BinData to load the file and get the data into a container, finally we can assign the container to the table field to store the image.
    container       con;
BinData         binData;
StoreImageTable storeImageTable;
;
binData = new BinData();
binData.loadFile(@”C:UsersmanuelDesktoplogo.jpg”);
con = binData.getData();
ttsbegin;
storeImageTable.clear();
storeImageTable.Id    = “00001″;
storeImageTable.Image = con;
storeImageTable.insert();
ttscommit;

2
 0  

No comments:

Post a Comment