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 the difference between vb 6 and vb.net?
What is a preprocessor directive in vb.net?
Why do we use ansi keyword?
What do you mean by serialization and deserialization and it's use.
Explain code security?
What is code access security?
Explain an assembly?
How vb implements the disconnected architecture as like vb.net?
Explain private assembly?
What is early binding?
How do you retrieve the customized properties of a .net application from xml .config file?
Which dll is used for microsoft .net run time?
Which is the tool which can convert visual basic old version to .net compatibility version?
What is a literal control?
What are the two main parts of .net?