Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys this is my first post on here. I've jsut recently picked up VB and am doing a project for my strength coach on campus. In one part of it I'm trying to pull an embeded jpg from an access db and it keeps giving me an 'invalid parameter used' error on build. I can't figure it out. This is the code I am using:

 

Protected Sub ReadImage()

Try

Dim i As Integer

i = CType(Me.BindingContext(PlayerDB, "PLAYERDB").Position, Integer)

Dim iPicture() As Byte = CType(PlayerDB.Tables("PLAYERDB").Rows(i)("PICTURE"), Byte())

Dim ms As New MemoryStream(iPicture)

Me.PlayerPicture.Image = Image.FromStream(ms)

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End Sub

 

 

My Database is named PlayerDB with a Table PLAYERDB(1 of 3 tables) and it has a PICTURE field set to OLE Object. Its also set to base64binary in the PlayerDB.xsd

I have about 15 fields in the table and all of them work like a champ except for this picture field. Any help you guys could give me would be greatly appreciated. Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...