There was required in one of project couple of months ago, wherein
the image files have to be stored/inserted into the database using BizTalk.
Although we know that keeping files on folder location is
much better than storing it in Database, we had to implement.
Note: BLOBs(Image files, Video files etc) smaller than 256KB are more efficiently handled by a database,while a filesystem is more efficient for those greater than 1MB. Of course, this will vary between different databases and filesystems.
It seemed to be challenging at the beginning, but was an
interesting experience for me and my colleague
Dhiraj Bhavsar.
To achieve this, we came up with a solution of creating a
Helper class which will convert the file into binary and later can be used .
Below is a screenshot of Helper Class, which accepts a file path as
input and returns data in bytes and deletes the file.
Note: This can used for other types of files also.
Download Helper Class Code : FileReader - Helper Class to convert file into Bytes
Have composed an article as to how to insert images in SQL, have a look : BizTalk Server 2010: How to Insert Image In SQL Through Orchestration
Download BizTalk Server 2010: How to Insert Image In SQL Through Orchestration Sample
Download Helper Class Code : FileReader - Helper Class to convert file into Bytes
Have composed an article as to how to insert images in SQL, have a look : BizTalk Server 2010: How to Insert Image In SQL Through Orchestration
Download BizTalk Server 2010: How to Insert Image In SQL Through Orchestration Sample
If you have questions or suggestions, feel free to do in comments section below !!!
Do share if you find this helpful .......
Knowledge Sharing is Caring !!!!!!
Tags:
BizTalk
This is great example dude. Thanks for including my contribution!!!
ReplyDeleteThanks for sharing the blog, it provide the information how Converting Image File to Binary.
ReplyDeleteImage Converter