H
harish
Hi friends
I am facing problem as follow
I can't display image from SQL Database to Picture box
Control.
Here are the codes that I am writing
Dim arrPicture() As Byte = _
CType(drSql.Item("Picture"), _
Byte())
Dim ms As New MemoryStream(arrPicture)
Try
With pctCategory
.Image = Image.FromStream(ms)
.SizeMode = PictureBoxSizeMode.CenterImage
End With
Catch exArg As ArgumentException
MessageBox.Show(exArg.ToString)
End Try
Following error is coming
"System.ArgumentException: Invalid parameter used.
at System.Drawing.Image.FromStream(Stream stream,
Boolean useEmbeddedColorManagement)
at System.Drawing.Image.FromStream(Stream stream)
at WindowsApplication1.frmCategory.FillData
(SqlDataReader drSql) in C:\HARISH\vb\Project1
\WindowsApplication1\frmCategory.vb:line 264"
I can save the picture to Database.
please reply
I am facing problem as follow
I can't display image from SQL Database to Picture box
Control.
Here are the codes that I am writing
Dim arrPicture() As Byte = _
CType(drSql.Item("Picture"), _
Byte())
Dim ms As New MemoryStream(arrPicture)
Try
With pctCategory
.Image = Image.FromStream(ms)
.SizeMode = PictureBoxSizeMode.CenterImage
End With
Catch exArg As ArgumentException
MessageBox.Show(exArg.ToString)
End Try
Following error is coming
"System.ArgumentException: Invalid parameter used.
at System.Drawing.Image.FromStream(Stream stream,
Boolean useEmbeddedColorManagement)
at System.Drawing.Image.FromStream(Stream stream)
at WindowsApplication1.frmCategory.FillData
(SqlDataReader drSql) in C:\HARISH\vb\Project1
\WindowsApplication1\frmCategory.vb:line 264"
I can save the picture to Database.
please reply