Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi !

I see your code and try to use in my app, but i received an "Out of memory"
at this line: pictureBox1.Image=Image.FromFile(strfn);

I´m Using VB Express and of course the syntaxs are diferent.

Can you please help me, I´m a few days "googling" and I can´t resolve this problem.

Thanks

My code VB Express working with Northwind.sdf DataBase SQL Compact

cn.Open()
Dim barrImg As Byte() = cmd.ExecuteScalar()
Dim strfn As String = "c:\papa.jpg" ' Convert.ToString(DateTime.Now.ToFileTime())
Dim fs As New FileStream(strfn, FileMode.Create, FileAccess.ReadWrite)
fs.Write(barrImg, 0, barrImg.Length)
fs.Flush()
fs.Close()
If File.Exists(strfn) Then
FotoPictureBox.Image = Image.FromFile(strfn)

End If
Posted

1 solution

Don't post this under Quick Answers - if you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
 
Share this answer
 
Comments
BryanWilkins 9-Jun-10 15:21pm    
I have seen a rash of these kind of posts lately... After looking at the site, I think this comes from having the "Quick Answers" link at the top of the article when viewing an article. This must be confusing to new users of the site. Maybe they think it is the proper way of asking questions when viewing articles. Maybe a proper thing would be to hide the "Quick Answer" link at the top when viewing an article. What do you think, should this be posted as a suggestion in the site bugs / suggestion forum?
[edit]You could well be right, I hadn't thought of that. Not a bad idea - please, do suggest it - you deserve the credit! - OriginalGriff[/edit]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900