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
Define manifest?
How a base class method is hidden?
Name some of the features present in vb 2005?
What do you mean by serialization and deserialization?
Explain the observations between vb.net and vc#.net?
Which is the tool which can convert visual basic old version to .net compatibility version?
How do you retrieve the customized properties of a .net application from xml .config file?
Explain option explicit?
Can you please explain the difference between authentication and authorization?
What is private assembly?
What are the different types of a stream?
Explain and brief about rapid application development tool?
Name the tool which can convert visual basic old version to .net compatibility version?
Sir, what code to store data from vb net sql server 2008 to 2005 and at the same time in order to validate the data entered is not the same, but there have been contacts in the module. Examples such as the log table that I created, the user name as the primary key.
what is common language specification?