Click here to Skip to main content
16,007,932 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
isgrom8-Feb-06 5:51
isgrom8-Feb-06 5:51 
Let me rephrase my question.

I'm using vb.net. I'm doing the following and this exeption was thrown. ex.message = invalid parameter used.

The msaccess db table column is set to type ole object. Try this, go to the db table and right click on the column and click inser object and insert a bmp. The column value will now display bitmap image. Try your code against that and you'll experience the problem. Why?

Dim cmd As OleDbCommand = New OleDbCommand(sql, cnn)
cnn.Open()
Dim b() As Byte
b = cmd.ExecuteScalar()
cnn.Close()


If (b.Length > 0) Then
Dim stream As New MemoryStream(b, True)
stream.Write(b, 0, b.Length)
'Display image
Dim PictureBox1 As New System.Windows.Forms.PictureBox

'exception is thrown at this statement
PictureBox1.Image = New Bitmap(stream)
'ex.message = invalid parameter used.

stream.Close()
End If
'conn.Close()


Why?

Thanks,
Glenn
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Dave Kreskowiak8-Feb-06 7:56
mveDave Kreskowiak8-Feb-06 7:56 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
isgrom8-Feb-06 9:06
isgrom8-Feb-06 9:06 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Dave Kreskowiak8-Feb-06 11:35
mveDave Kreskowiak8-Feb-06 11:35 
GeneralRe: HELP! How to convert msaccess bitmap image to long binary format??? Pin
Mekong River9-Feb-06 20:18
Mekong River9-Feb-06 20:18 
QuestionCopy data from Datagrid to form Pin
Jlawrnce7-Feb-06 10:54
Jlawrnce7-Feb-06 10:54 
AnswerRe: Copy data from Datagrid to form Pin
Jlawrnce7-Feb-06 11:53
Jlawrnce7-Feb-06 11:53 
GeneralRe: Copy data from Datagrid to form Pin
Jlawrnce7-Feb-06 13:56
Jlawrnce7-Feb-06 13:56 
QuestionSorry now in english => system.UnauthorizedAccessException during access on system directory Pin
cosma2177-Feb-06 10:28
cosma2177-Feb-06 10:28 
AnswerRe: Sorry now in english => system.UnauthorizedAccessException during access on system directory Pin
Guffa7-Feb-06 11:13
Guffa7-Feb-06 11:13 
GeneralRe: Sorry now in english => system.UnauthorizedAccessException during access on system directory Pin
cosma2177-Feb-06 11:22
cosma2177-Feb-06 11:22 
AnswerThe system directory is protected by the OS Pin
JUNEYT8-Feb-06 0:31
JUNEYT8-Feb-06 0:31 
GeneralRe: The system directory is protected by the OS Pin
cosma2178-Feb-06 4:46
cosma2178-Feb-06 4:46 
GeneralRe: The system directory is protected by the OS Pin
JUNEYT8-Feb-06 5:03
JUNEYT8-Feb-06 5:03 
GeneralRe: The system directory is protected by the OS Pin
cosma2178-Feb-06 8:36
cosma2178-Feb-06 8:36 
GeneralRe: The system directory is protected by the OS Pin
JUNEYT8-Feb-06 22:42
JUNEYT8-Feb-06 22:42 
GeneralRe: The system directory is protected by the OS Pin
cosma2179-Feb-06 16:40
cosma2179-Feb-06 16:40 
Questionsystem.UnauthorizedAccessException bei Zugriff auf Systemverzeichnis Pin
cosma2177-Feb-06 10:12
cosma2177-Feb-06 10:12 
AnswerRe: system.UnauthorizedAccessException bei Zugriff auf Systemverzeichnis Pin
Christian Graus7-Feb-06 10:59
protectorChristian Graus7-Feb-06 10:59 
QuestionA carriage Return Pin
Mark067-Feb-06 9:39
Mark067-Feb-06 9:39 
AnswerRe: A carriage Return Pin
Christian Graus7-Feb-06 9:51
protectorChristian Graus7-Feb-06 9:51 
GeneralRe: A carriage Return Pin
Mark067-Feb-06 9:59
Mark067-Feb-06 9:59 
GeneralRe: A carriage Return Pin
Christian Graus7-Feb-06 10:20
protectorChristian Graus7-Feb-06 10:20 
QuestionShowing image or icon on XP Button in VB.NET Pin
Hari Om Prakash Sharma7-Feb-06 7:42
Hari Om Prakash Sharma7-Feb-06 7:42 
AnswerRe: Showing image or icon on XP Button in VB.NET Pin
Mekong River7-Feb-06 15:05
Mekong River7-Feb-06 15:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.