daganlev
Member
- Joined
- Sep 20, 2006
- Messages
- 5
- Programming Experience
- Beginner
Hi ppl,
I hope this is the right place to ask...
I have created an update feature on my vb.net app that loads images from a server, it gets the picture as a stream from the server and than suppose to update it to the DB (MS-Access)
Here is the code:
This does not seem to work, I had put the result of the stream into a picturebox on the form i.e.
Picturebox1.Image = Image.FromStream(data)
and it did come out...
what am i doing wrong??? please help???
I hope this is the right place to ask...
I have created an update feature on my vb.net app that loads images from a server, it gets the picture as a stream from the server and than suppose to update it to the DB (MS-Access)
Here is the code:
VB.NET:
Dim html2 AsNew WebClient()
'reads the picture off the internet stream
Dim data2 As Stream = html2.OpenRead(txtURL.Text & "?id=" & id)
Dim cmd3 AsNew OleDb.OleDbCommand("insert into pics(data) values(?)", con2)
Dim data AsNew SqlClient.SqlParameter("@data", data2)
data.Direction = ParameterDirection.Input
cmd3.Parameters.Add(Image.FromStream(data))
cmd3.ExecuteNonQuery()
Picturebox1.Image = Image.FromStream(data)
and it did come out...
what am i doing wrong??? please help???
Last edited by a moderator: