Can somebody help me with a code that can show my images store in a Blob Field VarBinary(Max) in MS SQL 2005 database.
I use MS Virusal Studio 2008 and my program is written in VB.Net.
My dataset is DocumentView
The tablename is DocumentView
The Fieldname of my image is DocumentPicture
I Hope the hear soon.
Bart Jan
How to show a image from a Blob field in GDViewer?
Re: How to show a image from a Blob field in GDViewer?
Hi
This is what i do with SQL 2005 but i store images in the image data type rather than varbinary(max)
*servername\instance = the name of your SQL server and instance name i.e myserver\sql1
*Database Name = The name of your database i.e Document Database
hope this helps or gives you some clues
Cheers
steve
This is what i do with SQL 2005 but i store images in the image data type rather than varbinary(max)
Code: Select all
Dim Bits As Byte()
Dim Connection As New SqlConnection("data source=*servername\instance;initial catalog=*Database Name;Integrated Security=SSPI")
Dim DataAdaptor as New SqlDataAdapter
Dim DocumentView As New DataSet
DataAdaptor.SelectCommand = New SqlCommand("select * from DocumentView where documentname = xxxxx",Connection)
DataAdaptor.Fill(DocumentView, "DocumentView")
Bits = CType(DocumentView.Tables(0).Rows(0).Item("DocumentPicture"), Byte())
frmMain.Viewer.DisplayFromByteArray(bits)
frmMain.viewer.show()
*Database Name = The name of your database i.e Document Database
hope this helps or gives you some clues
Cheers
steve
Who is online
Users browsing this forum: No registered users and 0 guests