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
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!
What is enumerator?
Explain an assembly?
Can you please explain the difference between int and int32?
What is redim keyword and its use?
What are the objects in asp.net?
i have two class that contain's two methods as same name in derived class i have to call these two methods what will happen at run time ?
What is an assembly and its use?
source code for how to login a vb.net application ?
What is pre-jit?
What is meant by jagged arrays?
What is the exact defination of object?
Explain the difference between thread and process?
Name the two main parts of .net?
Explain the advantage of option strict on?