473,320 Members | 1,848 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,320 software developers and data experts.

image in asp.net

Sam
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #1
9 1690
Here's a couple good tutorials on the subject for you:
http://www.aspnetpro.com/features/20...200307so_f.asp
http://aspalliance.com/das/tutorial/fileupload.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #2
Here are a few good tutorials on the subject for you:
http://www.aspnetpro.com/features/20...200307so_f.asp
http://www.sqljunkies.com/HowTo/4D0E...2D55C96E8.scuk
http://aspalliance.com/das/tutorial/fileupload.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #3
Hi Sam,

One more..
http://www.dotnetbips.com/displayarticle.aspx?id=60

HTH
Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #4
Hi,

You have read the article in MSDN "KB317034"
"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #5
Sam
hi guys,
could you give me a sample program (if possible in vb.net) to display
picture from sql server using image control (but i don't like to save the
image in file and then display it).
maybe you have better idea ?
thanks,

"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,

Nov 18 '05 #6
Hi Sam,

If your images are dynamically generated you must take a look at the
DynamicImage user control
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

You may download the exe and execute the sample code within that.

HTH
Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
hi guys,
could you give me a sample program (if possible in vb.net) to display
picture from sql server using image control (but i don't like to save the
image in file and then display it).
maybe you have better idea ?
thanks,

"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,


Nov 18 '05 #7
Sam
yes, i have read the article, and i use the the dynamicimage control, but
there is something i don't understand, please look sample code below:

private function getEmployeePhoto(empid as integer) as byte()
............' code program............
end function

private sub button1_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(3)
end sub

private sub button2_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(5)
end sub

question:
when i click button1, the image(3) is display, then i click button2, but the
image(5) doesn't show up, the image(3) still there, doesn't change to
image(5). Why ?

thanks,
"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
Hi Sam,

If your images are dynamically generated you must take a look at the
DynamicImage user control
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

You may download the exe and execute the sample code within that.

HTH
Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
hi guys,
could you give me a sample program (if possible in vb.net) to display
picture from sql server using image control (but i don't like to save the image in file and then display it).
maybe you have better idea ?
thanks,

"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
hi,
how to retrieve(display) and save image in sql server?
thanks,



Nov 18 '05 #8
Hi Sam,
Can you post the complete code in which you are facing this problem ??

Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:uh****************@tk2msftngp13.phx.gbl...
yes, i have read the article, and i use the the dynamicimage control, but
there is something i don't understand, please look sample code below:

private function getEmployeePhoto(empid as integer) as byte()
...........' code program............
end function

private sub button1_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(3)
end sub

private sub button2_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(5)
end sub

question:
when i click button1, the image(3) is display, then i click button2, but the image(5) doesn't show up, the image(3) still there, doesn't change to
image(5). Why ?

thanks,
"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
Hi Sam,

If your images are dynamically generated you must take a look at the
DynamicImage user control
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

You may download the exe and execute the sample code within that.

HTH
Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
hi guys,
could you give me a sample program (if possible in vb.net) to display
picture from sql server using image control (but i don't like to save the image in file and then display it).
maybe you have better idea ?
thanks,

"Sam" <a1*****@hotmail.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
> hi,
> how to retrieve(display) and save image in sql server?
> thanks,
>
>
>



Nov 18 '05 #9
Sam
preliminary:

1.modify web.config accrding to the article

2. add reference to dynamicimage.dll

the code:

Private Sub GetCustomer(ByVal eid As Integer)

Dim cn As New SqlConnection(strcn)

cn.Open()

Dim cm As New SqlCommand("select * from employees where employeeid = " &
eid, cn)

cm.CommandType = CommandType.Text

Dim rd As SqlDataReader = cm.ExecuteReader(CommandBehavior.CloseConnection)

If rd.Read Then

If Not IsDBNull(rd("photo")) Then

Dim img As Byte() = CType(rd("photo"), Byte())

Dim ms As New MemoryStream(img, 78, img.Length - 78)

DynamicImage1.ImageBytes = ms.ToArray()

End If

End If

rd.Close()

cm.Dispose()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

GetCustomer(1)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

GetCustomer(2)

End Sub

questions:

1. when i click button1, the image from customer with id = 1, display in the
web, then i click button2, but image of customer with id = 2 doesn't appear
.. why ?

2. how to use openfiledialog in asp.net ?

thanks,

"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:uy**************@TK2MSFTNGP09.phx.gbl...
Hi Sam,
Can you post the complete code in which you are facing this problem ??

Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:uh****************@tk2msftngp13.phx.gbl...
yes, i have read the article, and i use the the dynamicimage control, but there is something i don't understand, please look sample code below:

private function getEmployeePhoto(empid as integer) as byte()
...........' code program............
end function

private sub button1_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(3)
end sub

private sub button2_click(..)....
dynamicImage1.imageBytes=getEmployeePhoto(5)
end sub

question:
when i click button1, the image(3) is display, then i click button2, but

the
image(5) doesn't show up, the image(3) still there, doesn't change to
image(5). Why ?

thanks,
"Ashish M Bhonkiya" <bh******@hotmail.com.nospam> wrote in message
news:Oz**************@TK2MSFTNGP11.phx.gbl...
Hi Sam,

If your images are dynamically generated you must take a look at the
DynamicImage user control
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
You may download the exe and execute the sample code within that.

HTH
Regards
Ashish M Bhonkiya

"Sam" <a1*****@hotmail.com> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
> hi guys,
> could you give me a sample program (if possible in vb.net) to display > picture from sql server using image control (but i don't like to
save the
> image in file and then display it).
> maybe you have better idea ?
> thanks,
>
> "Sam" <a1*****@hotmail.com> wrote in message
> news:ev**************@TK2MSFTNGP09.phx.gbl...
> > hi,
> > how to retrieve(display) and save image in sql server?
> > thanks,
> >
> >
> >
>
>



Nov 18 '05 #10

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
6
by: QuasiChameleon | last post by:
Hi, I'm trying to create a grayscale image class that reads and writes grayscale Targa format. This works well with smaller images, but corrupts larger images and creates a "Segmentation fault...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
3
by: Kristof Thys | last post by:
Hello, I'm writing a ASP.net webservice wich will visualize an image, generated by another application. The generated image is a char*. I can transform this to a String*, but I want to view it...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
1
by: bharathv6 | last post by:
i need to do is modify the image in memory like resizing the image in memory etc ... with out saving it disk as i have to return back the image with out saving it disk PIL supports the use of...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.