|
Subject:
|
ADO.NET(Retrieve image from databse)
|
|
Posted By:
|
lovelyphor
|
Post Date:
|
10/9/2004 1:20:50 AM
|
i want to retrieive the photo of employees stored in table employees of Northeind database. I have 4 buttons(First,Next,Previous,Last) and one PictureBox on the form. Coding of the Last button is as follows:
Dim bm As BindingManagerBase bm = Me.BindingContext(DsEmployees1, "employees") bm.Position = bm.Count - 1 Dim c As Integer = DsEmployees1.Tables("employees").Rows.Count Dim ctr As Integer = DsEmployees1.Tables(0).Rows.Count - 1
Dim bytEmpPhoto() As Byte =
DsEmployees1.Tables("employees").Rows(ctr)("Photo") Dim stmEmpPhoto As New MemoryStream(bytEmpPhoto) PictureBox1.Image = Image.FromStream(stmEmpPhoto)
This coding gives me an error: 'System.ArgumentException' occured. Error: Invalid Parameter Used.
lovely
|
|
Reply By:
|
Snib
|
Reply Date:
|
10/9/2004 10:17:10 AM
|
You have posted in the Feedback Forum. This topic would be more appropriate in one of the programming forums, in this case probably an ADO forum.
Thanks.
-Snib <>< Try new FreshView 0.2! There are only two stupid questions: the one you don't ask, and the one you ask more than once ;-)
|