How to store jpeg / gif / bmp image in database and how to
retrieve them? The most stressful condition is database is
distributed and stored images can be retrive from any
computer in network and any one can store images from other
computer!! plss help its urgent.......RAHUL RATHOD
Answer Posted / raj
Hi Rahul,
if you want to save image in SQL Server DataBase,
first we have to convert that image into bytes(BCoz SQL
Server support byte format).
using system.io.iostream we can convert image into stream
of bytes.
For example :
stfFilename is path that contain your image.
Public Shared Function LoadImage(ByVal stfFilename As
String) As System.Drawing.Image
Dim oStream As System.IO.Stream
Dim oAssembly As System.Reflection.Assembly
oAssembly = System.Reflection.Assembly.GetEntryAssembly
oStream = oAssembly.GetManifestResourceStream(stfFilename)
Return System.Drawing.Image.FromStream(oStream)
End Function
for retrieving image from DB just reverse concept.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain option explicit?
Can you please explain the difference between authentication and authorization?
what is interface and when it is used?
What is sorting in vb?
Explain code security?
Observations between vb.net and vc#.net?
What is the use of console application?
Explain how can we remove handlers at run time?
Which class allows an element to be accessed using unique key?
Explain about the ruby interface generator?
What is the top .net class that everything is derived from?
How do you retrieve the customized properties of a .net application from xml .config file?
What is misl code?
What is break mode? What are the options to step through code?
hello thank you for replying to my question regarding adding barcode fonts in vb.net project. I have downloaded a free font and added in my vb.net project but now i dont know how to use that i need to generate barcodes can any body help me how to use those fonts these are font3of9 .i need a small code to use these fonts to generate barcode thank u!