I am trying to import a file and view it but I am getting the error "out of memory". It is a PDF file 68k in size.
My code is below.
Thanks for the help
Connection1.Close()
Connection1.Open()
Me.OpenFileDialog1.FileName = "*.*"
If (Me.OpenFileDialog1.ShowDialog() = DialogResult.OK) Then
'copy file to bc-biztalk
currentfilename = OpenFileDialog1.FileName
filenamepos = InStrRev(currentfilename, "\")
TextBox1.Text = currentfilename
>> ERROR HERE >> PictureBox1.Image = Image.FromFile(TextBox1.Text)
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Open in new window