473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to retrieve images from sql server?

How to retrieve images from sql server?


--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 2.
MIEMBRO ACTIVO DE ALIANZADEV
Nov 18 '05 #1
1 1236
On Fri, 22 Oct 2004 08:13:10 -0500, "Luis Esteban Valencia"
<lu*******@haceb.com> wrote:
How to retrieve images from sql server?


Luis

Convert the image to text to save it in the database:

<code>
Public Overloads Shared Function ToString(ByVal image As
System.Drawing.Image) As String
Dim ms As New IO.MemoryStream
image.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
Return System.Convert.ToBase64String(ms.GetBuffer)
End Function

Public Shared Function FromString(ByVal imageString As String) As
System.Drawing.Image
Dim imageBytes() As Byte =
System.Convert.FromBase64String(imageString)
Dim ms As New IO.MemoryStream(imageBytes)
FromString = System.Drawing.Image.FromStream(ms)
ms.Close()
End Function
</code>

Hope this helps

Blu
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Michael Walton | last post by:
I need some help, because I am utterly confused with how to do this. I have 2 things that I need to figure out, and could use some sample code or just some general direction: 1) I need to build...
5
by: Jim Richards | last post by:
Hello all. I created the "student2" user account and set the password to "student2". I then went to Enterprise Manager and in the class_mgr database and in its customers table, I gave this...
3
by: | last post by:
Hi, I have a SQL Server database table where one of the columns is of type Image. The problem occurs when I try to retrieve images from the table. I'm using the following C# code: ...
2
by: John | last post by:
Hi all, I haven't a clue where to begin here (or more to the point - if it's even possible). I need to read the names of all the files inside a folder off my web site. The catch here is that...
6
by: David Bowey | last post by:
Hi There! I'm writing a custom HttpHandler to create watermarks on my PNG images of my website. So typically, a PNG image is linked in an ASPX page as follows... <img src="images/test.png"...
19
by: Lisa Jones | last post by:
Hi I don’t want to change my name or anything :) but I wish I was able to save Sound into SQL server and retrieve it So my question is How do you save a wav file into a SQL server and how do...
0
by: dfetrow410 | last post by:
I am using a datalist. I need to retrieve only selected values. I tried to use the following code below with no luck. Not sure how to do the backend <tr> <td align="left" valign="top"><img...
1
by: Cem | last post by:
Hi, in GridView1 I have following code: <ItemTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("airport_active", "images/icons/ico_airport_active_{0}.gif") %>'...
2
by: phpachu | last post by:
Hi, I hav created a group of textboxes using a loop and its names are unique and names are assigned using variable ( like <input type=text name=$name1>). Then How can i retrieve the values in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.